Skip to content

Commit 5a001fd

Browse files
author
Tom Schlick
authored
ignore the current model
1 parent 264cb9b commit 5a001fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Models/BaseModel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public static function recordChanges(int $event_type, $model) : void
3535

3636
collect($changes)
3737
->except(config('model-auditlog.global_ignored_fields'))
38+
->except([$this->getKeyName()]) // Ignore the current model's primary key
3839
->each(function ($change, $key) use ($event_type, $model) {
3940
$log = new static();
4041
$log->event_type = $event_type;

0 commit comments

Comments
 (0)