fix: [auditlog] use insert() rather than save() as that is not available in the behavior

- fixes exception on logging deletes, blocking any actual deletions
pull/79/head
iglocska 2021-11-24 01:33:26 +01:00
parent 22e4a90af0
commit 3cc857c42f
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 1 additions and 2 deletions

View File

@ -129,14 +129,13 @@ class AuditLogBehavior extends Behavior
$modelTitle = $entity[$modelTitleField];
}
$logEntity = $this->auditLogs()->newEntity([
$this->auditLogs()->insert([
'request_action' => $entity->getConstant('ACTION_DELETE'),
'model' => $entity->getSource(),
'model_id' => $this->old->id,
'model_title' => $modelTitle,
'change' => $this->changedFields($entity)
]);
$logEntity->save();
}
/**