owen-it / laravel-auditing

Record the change log from models in Laravel
https://laravel-auditing.com
MIT License
3.05k stars 390 forks source link

Queued Auditing #845

Closed Orrison closed 1 year ago

Orrison commented 1 year ago

Per discussions such as #562, this sets up auditing to be dispatched on the Queue.

By default, the listener will go onto the sync connection. So if no configuration is done, the package will work as it did before, auditing immediately in the current request.

Once you configure the audit.queue.connect to be something other than sync, the audits will then be dispatched to be processed asynchronously.

Customization of the queue it is put on, as well as the delay, is also possible.

It is set up similarly to the Auditing/Audited flow. An Event (DispatchingAudit) is fired where you can prevent the auditing dispatch from happening by having a listener return false. And there is the ability to swap out the ProcessDispatchAudit Listener if the end user needs to.

Orrison commented 1 year ago

Closed in favor of different fork location