laravel-auditing
laravel-auditing copied to clipboard
Run model auditing observer as job
Q | A |
---|---|
Bug? | no |
New Feature? | yes |
Framework | Laravel |
Framework version | 6.x |
Package version | 9.x |
PHP version | 7.x |
Actual Behaviour
Currently, when a model is changed, the observer was directly triggered.
Expected Behaviour
I wish a optional configurable behaviour, that a audit record is written by a job. Problem in my case is, that I am working with a big amount of data. I want audit any change but it's ok, when it's done some seconds later. In this situation I want win some time by move the auditing process to background.
Steps to Reproduce
Take existing model, change something and save.
Possible Solutions
Implement current observer auditing code into own class and call it directly or with job
I'm having the same issue. I'd like to run audit as a job.
I see the value of the idea. A bunch of operations could be pushed back doing this. Maybe let the observer trigger a new event that could queue for doing the actual work.
We will look into it