Skip to content

Commit

Permalink
[5.5] Model::$exists to be set to false when force-deleting a model…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
PGBI authored and taylorotwell committed Nov 16, 2017
1 parent 887740e commit fded7b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Illuminate/Database/Eloquent/SoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function forceDelete()
protected function performDeleteOnModel()
{
if ($this->forceDeleting) {
$this->exists = false;

return $this->newQueryWithoutScopes()->where($this->getKeyName(), $this->getKey())->forceDelete();
}

Expand Down

0 comments on commit fded7b4

Please sign in to comment.