ss-ipg/laravel-auditable
Attribute-based audit logging for Laravel Eloquent models. Add #[Auditable] to track create/update/delete/soft delete/restore events with old/new values, column include/exclude/redact, per-model event filters, JSON formatting, and extensible context providers.
User, Payment, MedicalRecord) is automatically logged with old/new values, accelerating debugging and rollback for production incidents.deleted events for Transaction).password, ssn) and environment-restricted logging (e.g., disable in testing).api_tokens from audits).#[Auditable(events: [AuditAction::Updated])] on Setting model).Adopt if:
tenant_id to every audit entry).Look elsewhere if:
Model::update([...])) heavily—these bypass Eloquent events and won’t be audited (requires custom middleware).For Executives: "This package automates compliance audits for Laravel apps, cutting audit prep time by 60% while reducing legal risk. For example, a HIPAA-compliant healthcare app can now track every change to patient records with one PHP attribute—no manual logging, no errors. It’s like adding a time machine for your data, so you always know who changed what and when. Zero dev time for basic audits; customizable for edge cases. ROI: 3–6 months saved vs. building a custom solution."
For Engineering:
*"This is Laravel’s answer to declarative auditing—think Laravel Scout for logs. Drop #[Auditable] on your models, and boom: all CRUD operations are logged with old/new values, soft deletes, and even IP/user context. It’s faster than writing observers, more reliable than manual logging, and flexible enough for compliance. Pros:
ObservesModelEvents boilerplate.Audit::fake().
Cons:Model::update()) won’t trigger audits (but you can add middleware).User, Payment, MedicalRecord) to validate compliance coverage before full rollout."*How can I help you explore Laravel packages today?