laravel-auditing icon indicating copy to clipboard operation
laravel-auditing copied to clipboard

Run model auditing observer as job

Open prodigy7 opened this issue 5 years ago • 2 comments

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

prodigy7 avatar Nov 12 '19 11:11 prodigy7

I'm having the same issue. I'd like to run audit as a job.

applyACS avatar Aug 05 '21 05:08 applyACS

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

MortenDHansen avatar Feb 08 '22 21:02 MortenDHansen