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

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article