Quantcast
Channel: Laravel News
Viewing all articles
Browse latest Browse all 1793

Laravel Activity Log Package →

$
0
0
Laravel Activity Log

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 Spatie\Activitylog\Models\Activity;

$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


Laravel Activity Log Package is a post from Laravel News.


Viewing all articles
Browse latest Browse all 1793

Trending Articles