Skip to content

Commit 373efca

Browse files
Added support for update event
1 parent 2736ae7 commit 373efca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AuditingTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static function bootAuditingTrait()
5656
});
5757

5858
static::saved(function ($model) {
59-
if ($model->isTypeAuditable('saved')) {
59+
if ($model->isTypeAuditable('saved') || $model->isTypeAuditable('updated')) {
6060
$model->auditUpdate();
6161
}
6262
});
@@ -398,7 +398,7 @@ public function isTypeAuditable($key)
398398
{
399399
$auditableTypes = isset($this->auditableTypes)
400400
? $this->auditableTypes
401-
: ['created', 'saved', 'deleted'];
401+
: ['created', 'saved', 'deleted', 'updated'];
402402

403403
// Checks if the type is in the collection of type-auditable
404404
if (in_array($key, $auditableTypes)) {

0 commit comments

Comments
 (0)