Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions config/audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@

'exclude' => [],

/*
|--------------------------------------------------------------------------
| Global exclusion merge
|--------------------------------------------------------------------------
|
| If set to true, the local model auditExclude array values will be
| merged with the config exclude array values instead of replacing
| them.
|
*/

'exclude_merge' => false,

/*
|--------------------------------------------------------------------------
| Empty Values
Expand Down
7 changes: 7 additions & 0 deletions src/Auditable.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ protected function resolveAuditExclusions()
*/
public function getAuditExclude(): array
{
if (
Config::get('audit.exclude_merge', false) ||
($this->auditExcludeMerge ?? false)
) {
return array_merge($this->auditExclude ?? [], Config::get('audit.exclude', []));
}

return $this->auditExclude ?? Config::get('audit.exclude', []);
}

Expand Down