Skip to content

Commit

Permalink
Merge branch 'release/v1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
chelout committed Apr 20, 2020
2 parents ebb1029 + 1a91c00 commit eba7f43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function attach($id, array $attributes = [], $touch = true)
public function detach($ids = null, $touch = true)
{
// Get detached ids to pass them to event
$ids = $ids ?? $this->parent->{$this->getRelationName()}->pluck('id');
$ids = $ids ?? $this->parent->{$this->getRelationName()}->pluck($this->relatedKey);

$this->parent->fireModelBelongsToManyEvent('detaching', $this->getRelationName(), $ids);

Expand Down
2 changes: 1 addition & 1 deletion src/MorphToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function attach($id, array $attributes = [], $touch = true)
public function detach($ids = null, $touch = true)
{
// Get detached ids to pass them to event
$ids = $ids ?? $this->parent->{$this->getRelationName()}->pluck('id');
$ids = $ids ?? $this->parent->{$this->getRelationName()}->pluck($this->relatedKey);

$this->parent->fireModelMorphToManyEvent('detaching', $this->getRelationName(), $ids);

Expand Down
2 changes: 1 addition & 1 deletion src/MorphedByMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function attach($id, array $attributes = [], $touch = true)
public function detach($ids = null, $touch = true)
{
// Get detached ids to pass them to event
$ids = $ids ?? $this->parent->{$this->getRelationName()}->pluck('id');
$ids = $ids ?? $this->parent->{$this->getRelationName()}->pluck($this->relatedKey);

$this->parent->fireModelMorphedByManyEvent('detaching', $this->getRelationName(), $ids);

Expand Down

0 comments on commit eba7f43

Please sign in to comment.