Audit Logs
A simple yet flexible Laravel package for recording model activity and authentication events as audit logs.
use BradieTilley\AuditLogs\Concerns\HasAuditLogs;
use BradieTilley\AuditLogs\Contracts\WithAuditLogs;
use Illuminate\Database\Eloquent\Model;
class Product extends Model implements WithAuditLogs
{
use HasAuditLogs;
}
$product = Product::create(['name' => 'Widget']);
// → "Product created"
$product->update(['name' => 'Gadget']);
// → "Product updated" with human-readable change details
Documentation
- Introduction
- Installation
- Activity Logs
- Change Logging
- Auth Events
- Recording Logs
- Querying Logs
- Customization
- Compatibility
Requirements
- PHP 8.3+
- Laravel 13+
Quick start
composer require bradietilley/laravel-audit-logs
php artisan vendor:publish --tag="audit-logs-migrations"
php artisan migrate
use BradieTilley\AuditLogs\Concerns\HasAuditLogs;
use BradieTilley\AuditLogs\Contracts\WithAuditLogs;
class User extends Model implements WithAuditLogs
{
use HasAuditLogs;
}
See Installation and Activity Logs for the full walkthrough.