laravel-auditing
laravel-auditing copied to clipboard
Is there a way to set user_id of audits table to null or other user_id
trafficstars
| Q | A |
|---|---|
| Bug? | no |
| New Feature? | no |
| Framework | Laravel |
| Framework version | 6.20.6 |
| Package version | 9.3.2 |
| PHP version | 7.3.23 |
Expected Behaviour
When user create model A, "system" automatically creates model B. The audit table then recorded the model B was created by A, not system.
However, the user wouldn't know that on the audit log he created model B. (Cuz in fact he only created model A by himeself.)
Is there a way to storage user_id into audits table without using Auth::guard()? A way to directly storage user_id into audits table? Much appreciated
You could put some flag on model B, so with transformAudit() you remove user_id when the flag is setted
closed due to inactivity