Laravel Auditing Not Logging old_values and new_values When Using saveQuietly in Observer #1030
Unanswered
kishan-pinetco
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Are you trying to escape a particular event being triggered? I don't know if either the particular event could be disabled for this situation or if you have to manually dispatch the audit event to ensure the change isn't as silent as it is currently |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the this package, and it's working fine for logging model events like created, updated, and deleted directly on models.
However, I'm running into an issue when using Laravel Observers. For example, I have a Product model with an observer that listens to the created and updated events. Inside the observer, I use $model->saveQuietly() to make some silent updates.
The audit logs are being created for created and updated events, but the old_values and new_values are missing — they’re either empty or not logged at all.
Has anyone faced this issue?
Is there a proper way to make Laravel Auditing capture old_values and new_values when using observers and saveQuietly()?
Any guidance or best practices would be appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions