File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 166
166
*/
167
167
168
168
'queue ' => [
169
+ 'enable ' => true ,
169
170
'connection ' => 'sync ' ,
170
171
'queue ' => 'default ' ,
171
172
'delay ' => 0 ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace OwenIt \Auditing ;
4
4
5
+ use Illuminate \Support \Facades \Config ;
5
6
use OwenIt \Auditing \Contracts \Auditable ;
6
7
use OwenIt \Auditing \Events \DispatchAudit ;
7
8
use OwenIt \Auditing \Events \DispatchingAudit ;
9
+ use OwenIt \Auditing \Facades \Auditor ;
8
10
9
11
class AuditableObserver
10
12
{
@@ -99,7 +101,15 @@ public function restored(Auditable $model)
99
101
100
102
protected function dispatchAudit (Auditable $ model )
101
103
{
102
- if (!$ model ->readyForAuditing () || !$ this ->fireDispatchingAuditEvent ($ model )) {
104
+ if (!$ model ->readyForAuditing ()) {
105
+ return ;
106
+ }
107
+
108
+ if (!Config::get ('audit.queue.enable ' , true )) {
109
+ return Auditor::execute ($ model );
110
+ }
111
+
112
+ if (!$ this ->fireDispatchingAuditEvent ($ model )) {
103
113
return ;
104
114
}
105
115
You can’t perform that action at this time.
0 commit comments