Skip to content

Commit 15e5f73

Browse files
committed
Merge pull request #12386 from ryanwinchester/5.1
[5.1] Allow BelongsToMany::saveMany() to accept collections
2 parents db3230e + 94410e4 commit 15e5f73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,11 @@ public function save(Model $model, array $joining = [], $touch = true)
563563
/**
564564
* Save an array of new models and attach them to the parent model.
565565
*
566-
* @param array $models
566+
* @param \Illuminate\Support\Collection|array $models
567567
* @param array $joinings
568568
* @return array
569569
*/
570-
public function saveMany(array $models, array $joinings = [])
570+
public function saveMany($models, array $joinings = [])
571571
{
572572
foreach ($models as $key => $model) {
573573
$this->save($model, (array) Arr::get($joinings, $key), false);

0 commit comments

Comments
 (0)