Skip to content

Commit fded7b4

Browse files
PGBItaylorotwell
authored andcommitted
[5.5] Model::$exists to be set to false when force-deleting a model using SoftDeletes (#22100)
* Model::$exists to be set to false when (force)deleting a model using SoftDeletes * Model::$exists set to false on force deletion only for soft deleteable models
1 parent 887740e commit fded7b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Illuminate/Database/Eloquent/SoftDeletes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public function forceDelete()
4545
protected function performDeleteOnModel()
4646
{
4747
if ($this->forceDeleting) {
48+
$this->exists = false;
49+
4850
return $this->newQueryWithoutScopes()->where($this->getKeyName(), $this->getKey())->forceDelete();
4951
}
5052

0 commit comments

Comments
 (0)