Commit cacdcc1e authored by fungku's avatar fungku

Allow EmbedsOneOrMany::saveMany to accept a collection

parent 316426dd
......@@ -156,14 +156,16 @@ abstract class EmbedsOneOrMany extends Relation {
}
/**
* Attach an array of models to the parent instance.
* Attach a collection of models to the parent instance.
*
* @param array $models
* @return array
* @param \Illuminate\Database\Eloquent\Collection|array $models
* @return \Illuminate\Database\Eloquent\Collection|array
*/
public function saveMany(array $models)
public function saveMany($models)
{
array_walk($models, array($this, 'save'));
foreach ($models as $model) {
$this->save($model);
}
return $models;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment