Audit Log
Every write to the system is logged. Find who changed what, when, and what the previous value was.
Audit Log
Every create, update, and delete across the mobility app is captured in the audit log. It's the single place a compliance officer, a curious manager, or an incident responder can go to answer "who did that?" without digging through application logs.
The log page lives at Settings → Audit Log. Admins and fleet managers can see everything for their tenant; other roles see entries scoped to records they can access.
What's logged
Every model that uses the LogsActivity trait (spatie/laravel-activitylog) emits an entry on:
- Create — the full attribute set of the new record.
- Update — only the fields that actually changed, with
oldandnewvalues. - Delete — the full attribute set immediately before deletion (soft or hard).
Models currently under audit:
| Category | Models |
|---|---|
| Assets | Asset, AssetPhoto, AssetPresence |
| Maintenance | WorkOrder, WorkOrderLabor, WorkOrderPart, WorkOrderExpense, Inspection, InspectionItem, ServiceSchedule |
| Drivers & time | Driver, DriverAssetAssignment, TimeEntry, PayPeriod, UserPayProfile |
| Inventory | Part, PartsUsage, StockMovement, PurchaseOrder, PurchaseOrderLine, PurchaseOrderReceipt |
| Compliance | Document, DocumentVersion, License, Warranty, WarrantyClaim, Recall, AssetRecall |
| Users | User, Role, Permission, role assignments |
| Automations | Automation, AutomationLog (also carries the trigger + action audit) |
Reads are not logged by default. If you need read-audit for a sensitive entity (typically Documents), enable it via DocumentAccessLog — the system ships with access logging specifically for the Documents module.
Entry fields
Every audit log row carries:
| Field | Value |
|---|---|
log_name | A human-readable category, usually the model name (e.g. asset, work_order). |
description | Event verb — created, updated, deleted, restored. |
subject_type / subject_id | Polymorphic reference to the record that was changed. |
causer_type / causer_id | Who did it — usually User but can be System for scheduled jobs. |
properties | JSON blob: { old: {...}, attributes: {...} } on updates; just attributes on creates. |
tenant_id | Every entry is tenant-scoped via the LogsActivity trait's global scope. |
created_at | When it happened. |
Reviewing entries
The Audit Log page is a filterable table:
- User — async picker; entries where
causer_idmatches. - Entity type — dropdown of logged models.
- Entity ID — free-text to drill to a specific record.
- Action —
created/updated/deleted/restored. - Date range — inclusive.
Clicking any row opens a drawer with:
- The causing user's avatar + role.
- The subject with a deep link (e.g. "Work Order #1284").
- A diff view showing each changed field with the previous value struck through and the new value in green.
- The raw
propertiesJSON for anyone who needs it.
Per-record history
Every detail page that carries an audited model has a History tab that prefilters the audit log by that record. One click from any asset, WO, inspection, or driver to the complete change history of that specific record.
Retention
Audit entries are kept indefinitely by default — rotating them out is a destructive operation we'd rather not make easy. If you need to trim (e.g. GDPR right-to-erasure), contact support for an assisted purge.
Exporting
The filtered list has a Export CSV button. Entries are streamed (no row cap) with every field above flattened to CSV.
Permissions
- Admin / Fleet Manager — full access, any user's actions.
- All other roles — can see audit entries where
subject_idis a record they're authorised to read. A mechanic sees audit entries on work orders they can access, but not on user-management entries.
API
Read-only, paginated, filter-rich:
Related
- Documents → Access Log — read audit for the sensitive-document module.
- Permissions — what each role can see in the log.
- API Keys — tokens carry a
causer_id, so API-driven changes still land with a proper user attribution.