Download the PHP package bhhaskin/laravel-audit without Composer
On this page you can find all versions of the php package bhhaskin/laravel-audit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bhhaskin/laravel-audit
More information about bhhaskin/laravel-audit
Files in bhhaskin/laravel-audit
Package laravel-audit
Short Description Audit trail package for Laravel applications with UUID support.
License MIT
Informations about the package laravel-audit
Laravel Audit
Lightweight audit trail package for Laravel applications.
Features
- Records
created,updated,deleted, andrestoredevents for any model. - Stores both numeric primary keys and UUIDs for audits, auditable models, and users.
- Captures before/after state, request metadata, and user attribution.
- Ships with ready-to-run migrations plus publishable stubs and configuration.
Installation
Laravel auto-discovers the service provider. For older versions add LaravelAudit\AuditServiceProvider::class to the providers array in config/app.php.
Publish Assets
Run the migration:
Usage
- Add the
Auditabletrait to any Eloquent model that you want to track. - Ensure the model has a
uuidcolumn populated via the includedHasAuditUuidtrait or your own logic.
Audits are exposed through the audits() relationship:
Configuration
Published configuration (config/audit.php) lets you:
- Enable/disable the logger or specific events.
- Ignore fields such as timestamps when diffing changes.
- Add default metadata and provide a custom user resolver.
The default user resolver defers to Laravel's auth() helper. Implement a custom resolver by binding a callable class and updating user_resolver in the config.
Events
Two framework events are fired for each audit lifecycle:
LaravelAudit\Events\AuditRecording(before persistence) exposes the proposed payload for last-minute tweaks.LaravelAudit\Events\AuditRecorded(after persistence) includes the savedAuditmodel instance.
Listen for these events to trigger notifications, broadcast changes, or enrich metadata.
License
MIT © Bryan
Testing
All versions of laravel-audit with dependencies
illuminate/support Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0