Commit ea5299d9 authored by Jens Segers's avatar Jens Segers

Fixes #256

parent 5bd7ee64
......@@ -60,6 +60,9 @@ class BelongsToMany extends EloquentBelongsToMany {
// if they exist in the array of current ones, and if not we will insert.
$current = $this->parent->{$this->otherKey} ?: array();
// See issue #256.
if ($current instanceof Collection) $current = $ids->modelKeys();
$records = $this->formatSyncList($ids);
$detach = array_diff($current, array_keys($records));
......
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