@@ -46,7 +46,7 @@ trait Auditable
4646 */
4747 public static function bootAuditable ()
4848 {
49- if (static ::isAuditingEnabled ()) {
49+ if (! self :: $ auditingDisabled && static ::isAuditingEnabled ()) {
5050 static ::observe (new AuditableObserver ());
5151 }
5252 }
@@ -284,8 +284,8 @@ public function toAudit(): array
284284 'event ' => $ this ->auditEvent ,
285285 'auditable_id ' => $ this ->getKey (),
286286 'auditable_type ' => $ this ->getMorphClass (),
287- $ morphPrefix. '_id ' => $ user ? $ user ->getAuthIdentifier () : null ,
288- $ morphPrefix. '_type ' => $ user ? $ user ->getMorphClass () : null ,
287+ $ morphPrefix . '_id ' => $ user ? $ user ->getAuthIdentifier () : null ,
288+ $ morphPrefix . '_type ' => $ user ? $ user ->getMorphClass () : null ,
289289 'url ' => $ this ->resolveUrl (),
290290 'ip_address ' => $ this ->resolveIpAddress (),
291291 'user_agent ' => $ this ->resolveUserAgent (),
@@ -488,7 +488,7 @@ public static function isAuditingEnabled(): bool
488488 return Config::get ('audit.console ' , false );
489489 }
490490
491- return true ;
491+ return Config:: get ( ' audit.enabled ' , true ) ;
492492 }
493493
494494 /**
0 commit comments