Skip to content

Commit

Permalink
Fix unreachable statements, missing syncChanges()
Browse files Browse the repository at this point in the history
  • Loading branch information
zambodaniel authored and sunel committed Jul 20, 2021
1 parent 100805e commit e347a42
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,6 @@ protected function performUpdate(Builder $query, array $options = [])

return true;
});

// Once we have run the update operation, we will fire the "updated" event for
// this model instance. This will allow developers to hook into these after
// models are updated, giving them a chance to do any special processing.
$dirty = $this->getDirty();

if (count($dirty) > 0) {
$this->fireModelEvent('updated', false);
}

$this->syncChanges();
}

return true;
Expand All @@ -363,6 +352,9 @@ public function updateMainTable(Builder $query, array $options, $attributes, $lo

$numRows = $this->setKeysForSaveQuery($query)->update($mainData);

// @see Illuminate\Database\Eloquent\Concerns\HasAttributes::syncChanges()
$this->changes = $mainData;

$this->fireModelEvent('updated.main', false);

return true;
Expand Down

0 comments on commit e347a42

Please sign in to comment.