Skip to content

Commit 0379d97

Browse files
Merge pull request owen-it#504 from owen-it/8.0
8.0
2 parents a8b2a6b + 1ad0799 commit 0379d97

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
/vendor
33
composer.lock
4+
.vscode

config/audit.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
return [
44

5+
'enabled' => env('AUDITING_ENABLED', true),
6+
57
/*
68
|--------------------------------------------------------------------------
79
| Audit Implementation

src/Auditable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)