Skip to content

Commit

Permalink
run syncOriginal in soft-deleting, only if $query->update($columns)
Browse files Browse the repository at this point in the history
… is updated something.
  • Loading branch information
TBlindaruk committed Jun 1, 2018
1 parent 10c549f commit c9d8b35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Illuminate/Database/Eloquent/SoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ protected function runSoftDelete()
$columns[$this->getUpdatedAtColumn()] = $this->fromDateTime($time);
}

$query->update($columns);
$updated = $query->update($columns);

$this->syncOriginal();
if($updated) {
$this->syncOriginal();
}
}

/**
Expand Down

0 comments on commit c9d8b35

Please sign in to comment.