Download the PHP package jeevanjoshi/laravel-audit-trail without Composer
On this page you can find all versions of the php package jeevanjoshi/laravel-audit-trail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeevanjoshi/laravel-audit-trail
More information about jeevanjoshi/laravel-audit-trail
Files in jeevanjoshi/laravel-audit-trail
Package laravel-audit-trail
Short Description Automatic model change tracking with revert capability for Laravel
License MIT
Informations about the package laravel-audit-trail
Laravel Audit Trail
A powerful, zero-configuration audit trail package for Laravel. Automatically tracks every create, update, and delete on your Eloquent models with a beautiful built-in dashboard.
Features
- Automatic model change tracking — just add one trait
- Records old and new values for every change
- Captures who made the change, from which IP, and when
- Beautiful built-in dashboard at
/audit-trail - One-click revert to any previous state
- Expandable diff view for changes
- Filterable by model, action, user, date range
- Fully configurable via config file
- Excludes sensitive fields like passwords automatically
- Works with any model — User, Invoice, Order, anything
Requirements
- PHP 8.1 or higher
- Laravel 9 to 12
Installation
Install via Composer:
The package will be auto-discovered by Laravel. No manual configuration needed.
Setup
1. Publish and run the migration
This creates the audit_trails table in your database.
2. Add the trait to any model you want to track
That's it. Every create, update, and delete on this model is now tracked automatically.
Dashboard
Visit the audit trail dashboard at: https://your-app.com/audit-trail
The dashboard shows:
- Total changes, today's changes, deletions, active users
- Full change history with old and new values
- Filters by model, action, model ID, and date range
- Revert button to restore any previous state
By default the dashboard is protected by auth middleware. Make sure your app has authentication set up.
Querying Audit History
Reverting Changes
Silent Updates (without logging)
Useful for updates that aren't meaningful — like updating timestamps, counters, or cache fields.
Excluding Fields Per Model
Configuration
Publish the config file:
This creates config/audit-trail.php in your application:
Customizing the Dashboard UI
Publish the views to customize them:
This copies the views to resources/views/vendor/audit-trail/ in your application. Edit them freely — they won't be overwritten when you update the package.
Environment Variables
Add these to your .env to configure without touching the config file:
Real World Use Cases
- Hospital systems — track who changed patient records and when
- Financial apps — full audit log of every transaction change
- SaaS apps — show teams what changed in their account
- eCommerce — track order and inventory changes
- HR systems — log every change to employee records
- Any app — know exactly what changed, who changed it, and when
Available Scopes
Security
The dashboard is protected by auth middleware by default. To add additional protection:
Sensitive fields like password and remember_token are never logged regardless of configuration.
Testing
Cleaning Old Logs
Run the cleanup command manually:
The command will:
- Check how many logs are older than
keep_for_days - Ask for confirmation before deleting
- Show how many records were deleted
Changelog
v1.0.0
- Initial release
- Automatic model change tracking
- Built-in dashboard with filters
- Revert to previous state
- Configurable excluded fields
- Per-model field exclusions
- Silent updates with withoutAudit()
License
MIT License. See LICENSE for more information.
Author
Jeevan Joshi
- GitHub: @thecrazydiamond1
- Email: [email protected]
All versions of laravel-audit-trail with dependencies
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0