Skip to content

Commit

Permalink
Detect changes on saving event to catch creating too
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgaal committed Sep 4, 2018
1 parent 2767b47 commit 9e783b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Concerns/DetectsChanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait DetectsChanges
*/
protected static function bootDetectsChanges()
{
static::updating(function (Model $model) {
static::saving(function (Model $model) {
$oldModel = $model->replicate()->setRawAttributes($model->getOriginal());

$model->oldAttributes = $oldModel->getLoggedAttributeValues();
Expand Down

0 comments on commit 9e783b6

Please sign in to comment.