Skip to content

Commit

Permalink
add sync without detaching method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Aug 15, 2016
1 parent 309aaff commit 33aee31
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,17 @@ public function createMany(array $records, array $joinings = [])
return $instances;
}

/**
* Sync the intermediate tables with a list of IDs without detaching.
*
* @param \Illuminate\Database\Eloquent\Collection|array $ids
* @return array
*/
public function syncWithoutDetaching($ids)
{
return $this->sync($ids, false);
}

/**
* Sync the intermediate tables with a list of IDs or collection of models.
*
Expand Down

0 comments on commit 33aee31

Please sign in to comment.