Video
Premium
Description
Provides easy to use functions to log the activities of the users of your app.
Here's a demo of how you can use it:
activity()->log('Look, I logged something');
You can retrieve all activity using the Spatie\Activitylog\Models\Activity model.
Activity::all();
Here's a more advanced example:
activity() ->performedOn($anEloquentModel) ->causedBy($user) ->withProperties(['customProperty' => 'customValue']) ->log('Look, I logged something'); $lastLoggedActivity = Activity::all()->last(); $lastLoggedActivity->subject; //returns an instance of an eloquent model$lastLoggedActivity->causer; //returns an instance of your user model$lastLoggedActivity->getProperty('customProperty'); //returns 'customValue'$lastLoggedActivity->description; //returns 'Look, I logged something'
Related Content on Laravel Daily
Video
Video
Premium
Spatie Activity Log Package: Deeper Dive
Video
Recent Courses on Laravel Daily
AI Agents/IDEs for Laravel: May 2026 (Claude Code, Codex, OpenCode, etc)
7 lessons
52 min
Roles and Permissions in Laravel 13
14 lessons
57 min
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read