spatie/laravel-activitylog
Log user and model activity in Laravel with an easy API. Manually record actions or automatically log Eloquent events, attach subjects/causers and custom properties, and query everything via the Activity model stored in the activity_log table.
Audit Logging for Compliance & Security
User Activity Tracking for Analytics
Debugging & Operational Insights
dd() debugging with structured logs for post-mortems (e.g., "Why did this order fail?").Roadmap: Event-Driven Architecture
ActivityLogged) to trigger notifications, analytics, or workflows.Build vs. Buy: Avoid Custom Solutions
Log::info()) with a standardized, queryable audit trail.Use Cases
price from $10 to $15").Adopt if:
Post updates, not Comment deletes).Look elsewhere if:
*"This package lets us automatically track every critical action in our app—like a digital breadcrumb trail—without writing custom code. It’s like adding a ‘black box recorder’ to our software, which helps with:
It’s free, battle-tested (used by 5K+ projects), and integrates seamlessly with our Laravel stack. The cost of not having this? Risk, inefficiency, and lost insights."*
*"This solves three major pain points:
Log::info() spaghetti with a structured, queryable audit log.Post::updated) with one line of config.Example use cases we can tackle immediately:
Trade-offs:
activity_log table (~50KB overhead per 1K entries).Next steps:
User, Order, Post).Activity::forModel($post)->latest()->take(10)).Alternatives considered:
How can I help you explore Laravel packages today?