Laravel Packages

Laravel Activity Log Package

Published
Laravel Activity Log Package image

Freek Van der Herten has created a new package that will allow you to easily setup an activity log for your users. It includes two methods of logging activities, a Model trait and an Activity::log() facade.

Not only can you log events but you can pull them out using:

use SpatieActivitylogModelsActivity;
 
$latestActivities = Activity::with('user')->latest()->limit(100)->get();

Of course this wouldn’t be complete without an automatic way of cleaning up old logs:

Activity::cleanLog();

The cleanLog sounds like a perfect pairing with the Laravel 5 Scheduler

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
The Laracon Archive image

The Laracon Archive

Read article
Group Adjacent Collection Items in Laravel with chunkBy() image

Group Adjacent Collection Items in Laravel with chunkBy()

Read article
Laravel queue:work Now Prints Why the Worker Stopped image

Laravel queue:work Now Prints Why the Worker Stopped

Read article
Sidecar Brings Statamic's Control Panel to Your Existing Markdown Sites image

Sidecar Brings Statamic's Control Panel to Your Existing Markdown Sites

Read article
Collections chunkBy() and Storage Path Hardening in Laravel 13.30 image

Collections chunkBy() and Storage Path Hardening in Laravel 13.30

Read article
Forte: Parse and Rewrite Laravel Blade Templates image

Forte: Parse and Rewrite Laravel Blade Templates

Read article