We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 316426d commit cacdcc1Copy full SHA for cacdcc1
src/Jenssegers/Mongodb/Relations/EmbedsOneOrMany.php
@@ -156,15 +156,17 @@ public function save(Model $model)
156
}
157
158
/**
159
- * Attach an array of models to the parent instance.
+ * Attach a collection of models to the parent instance.
160
*
161
- * @param array $models
162
- * @return array
+ * @param \Illuminate\Database\Eloquent\Collection|array $models
+ * @return \Illuminate\Database\Eloquent\Collection|array
163
*/
164
- public function saveMany(array $models)
+ public function saveMany($models)
165
{
166
- array_walk($models, array($this, 'save'));
167
-
+ foreach ($models as $model) {
+ $this->save($model);
168
+ }
169
+
170
return $models;
171
172
0 commit comments