v2.1 2017-10-02 20:00 UTC


A simple activity logger for Laravel.

Scrutinizer Quality Score Latest Stable Version License


Via Composer

$ composer require jeroen-g/activity-logger

The following command installs the package without the testing requirements.

$ composer require jeroen-g/activity-logger --update-no-dev

Laravel 5.5 automatically installs the package, for previous versions, follow the next two steps. After that, don't forget to run php artisan migrate Add the service provider in config/app.php:


And in the same file, add the alias:

'Activity' =>  JeroenG\ActivityLogger\Facades\ActivityLogger::class,


Log an activity

Activity::log($message, $context, $date);

Message is required, the rest is optional. $context is an array which can contain any data you want to save. $date is a timestamp, it defaults to the current timestamp.

Get all logs


Get one log

You only need to pass the id of a log.


Get all logs within timespan

$yesterday = Carbon\Carbon::yesterday();
$tomorrow = Carbon\Carbon::tomorrow();

Activity::getLogsBetween($yesterday, $tomorrow);

This function needs two parameters, all logs created between these timestamps are returned.

Get the most recent logs


The default of 5 logs is used when no number is passed.