Activity Log
A unified audit trail of every meaningful action across the admin panel — who, what, when, from where.
Route
GET /admin/activity
Paginated, filterable by actor, subject type, action, and date range.
Log record
| Column | Notes |
|---|---|
id | UUID PK |
actor_id | UUID FK → users.id (nullable for system events) |
actor_name | Denormalized actor name (preserved if user deleted) |
action | Verb (created, updated, deleted, published, restored, login, logout, …) |
subject_type | Class of the affected model (ContentEntry, User, MediaFile, …) |
subject_id | UUID of the affected record |
subject_label | Denormalized label (e.g. entry title) for fast list rendering |
changes | JSON diff: { before: {...}, after: {...} } |
context | JSON metadata (ip, user agent, source: admin or api) |
created_at | When it happened |
How records are written
An observer registered on the main domain models writes a row on every relevant lifecycle event. The diff is computed from the model's dirty attributes plus the JSON data column for entries.
Filtering UI
- Date range picker (last 24h, 7d, 30d, custom)
- Actor multi-select
- Subject type chips (Entry, User, Role, Media, Setting, Form, …)
- Action filter (created, updated, deleted, published, login, …)
- Free-text search over
subject_label
Retention
By default, activity rows are retained indefinitely. For high-volume installations, schedule a pruning job (php artisan activity:prune --days=180) to keep table size manageable.
TipPair the activity log with revisions: activity tells you who did what when; revisions let you see and restore the prior state.