Keep an audit log of who did what, and how they came in

Written from model events, spatie's role events and panel sign-ins, only for
what a person did, with secrets masked; pruned after a year.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 10:08:01 +02:00
parent 9bdbf834f6
commit 1fe1e67773
18 changed files with 744 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
declare(strict_types=1);
use App\Models\AuditLog;
use Illuminate\Support\Facades\Schedule;
/*
@@ -44,3 +45,10 @@ Schedule::command('repos:sync')
})
->withoutOverlapping()
->runInBackground();
// Old audit entries: they name people and the addresses they worked from, so
// they are kept for `audit.retention_days` and no longer.
Schedule::command('model:prune', ['--model' => [AuditLog::class]])
->daily()
->withoutOverlapping()
->runInBackground();