Skip to content

Commit

Permalink
[7.x] $this->exists is not updated after pivot delete (#33347)
Browse files Browse the repository at this point in the history
* Update AsPivot.php

$this->exists = false is not set, if no primary key is defined

* Update AsPivot.php

* Update AsPivot.php

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
tobiasnitsche and taylorotwell authored Jun 26, 2020
1 parent a915bdb commit 2dc71a5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public function delete()
$this->touchOwners();

return tap($this->getDeleteQuery()->delete(), function () {
$this->exists = false;

$this->fireModelEvent('deleted', false);
});
}
Expand Down

0 comments on commit 2dc71a5

Please sign in to comment.