created, updated, and deleted event is automatically captured — including a full before/after diff of the changed attributes, who made the change, and where the request came from.
Installation
Install via Composer and publish the config and migrations in minutes.
Quickstart
Add the
HasAuditLog trait and start recording model changes right away.Drivers
Route logs to a database table, a log file, or fan out to both simultaneously.
API Reference
Explore the full PHP API: trait properties, facade methods, and model scopes.
Why ModelScribe?
Most audit log packages give you one destination. ModelScribe is built around a driver architecture — the same entry can flow to a database table, a Laravel log channel, or any custom target you register. Each model can independently choose its driver and log table, making it straightforward to keeporders and invoices in separate tables or separate database connections.
Trait-Based
One line of code activates auditing on any Eloquent model. No observers to register manually.
Multi-Table Routing
Map each model to its own log table or database connection using named stores.
Deep Diffing
Every
updated event records the exact attributes that changed, old value and new.Rich Context
Automatically captures URL, IP address, User Agent, and the authenticated causer.
Flexible Retention
Choose permanent storage, time-based expiry, or a rolling window of N records.
Custom Drivers
Register your own driver (ELK, webhooks, etc.) with a single
extend() call.Getting Started
1
Install the package
Pull ModelScribe into your project via Composer:
2
Publish and migrate
Publish the config file and database migration, then run migrations:
3
Add the trait
Drop
HasAuditLog onto any Eloquent model to start recording changes:4
Query your logs
Use the
ScribeLog model and its built-in scopes to read audit records: