diff --git a/src/Traits/LogsActivity.php b/src/Traits/LogsActivity.php index 9ccc2080..f3bf1d5d 100644 --- a/src/Traits/LogsActivity.php +++ b/src/Traits/LogsActivity.php @@ -9,6 +9,7 @@ use Illuminate\Support\Collection; use Spatie\Activitylog\ActivityLogger; use Spatie\Activitylog\ActivitylogServiceProvider; +use Spatie\Activitylog\ActivityLogStatus; trait LogsActivity { @@ -128,7 +129,9 @@ public function attributesToBeIgnored(): array protected function shouldLogEvent(string $eventName): bool { - if (! $this->enableLoggingModelsEvents) { + $logStatus = app(ActivityLogStatus::class); + + if (! $this->enableLoggingModelsEvents || $logStatus->disabled()) { return false; }