foxen/laravel-model-activity-log
Automatically log Eloquent model activity in Laravel: create, update (with attribute diffs), delete, and restore (SoftDeletes). Supports per-model log names, ignoring or redacting attributes, tracks the authenticated user or falls back to “System”, and can prune old entries.
causer_id) to models, useful for accountability in collaborative environments (e.g., SaaS platforms, internal tools).Adopt When:
SoftDeletes trait).Look Elsewhere If:
For Executives: "This package lets us automatically track every change to critical data (e.g., user profiles, orders) without writing custom code—saving dev time while ensuring compliance with audit requirements. For example, if a support agent updates a customer record, we’ll log who made the change, what was altered, and when, all with zero manual effort. It’s like adding a ‘black box recorder’ to our database for a fraction of the cost of a custom build. The MIT license means no vendor lock-in, and the pruning feature keeps storage costs low."
For Engineering: *"This is a lightweight, trait-based solution to replace ad-hoc logging across models. Key benefits:
use LogsActivity to enable tracking for created, updated, deleted, and restored events.SoftDeletes out of the box.For Developers:
*"Imagine never writing Model::created() listeners again. This package:
prune_after_days: 90).User, Order, and Product models to instantly get a full audit trail. To customize, just extend the ActivityLog model or override the trait methods."*How can I help you explore Laravel packages today?