Skip to content

Commit 85b2878

Browse files
authored
[10.x] Mark model instanse as not exists on deleting MorphPivot relation. (#50135)
* Mark model instanse as not exists on deleting MorphPivot relation. On deleted event, the model is marked as existing. Like in AsPivot::delete() * Update MorphPivot.php
1 parent cf95132 commit 85b2878

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function delete()
6868
$query->where($this->morphType, $this->morphClass);
6969

7070
return tap($query->delete(), function () {
71+
$this->exists = false;
72+
7173
$this->fireModelEvent('deleted', false);
7274
});
7375
}

0 commit comments

Comments
 (0)