vjlau/laravel-activity-log is a Laravel package for laravel activity log.
It currently has 2 GitHub stars and 19 downloads on Packagist.
Install it with composer require vjlau/laravel-activity-log.
Discover more Laravel packages by vjlau
or browse all Laravel packages to compare alternatives.
Last updated
Laravel Activity Log
Make sure you have the MongoDB PHP driver installed. You can find installation instructions at http://php.net/manual/en/mongodb.installation.php
Install through Composer
composer require vjlau/laravel-activity-log
And add a new mongodb connection config/database.php:
'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'options' => [
'database' => 'admin' // sets the authentication database required by mongo 3
]
],
Add the ActivityLogServiceProvider to the providers array in the config/app.php file;
Jenssegers\Mongodb\MongodbServiceProvider::class,
VJLau\ActivityLog\ActivityLogServiceProvider::class,
VJLau\ActivityLog\QueryLogServiceProvider::class,
php artisan vendor:publish --provider="VJLau\ActivityLog\ActivityLogServiceProvider" --tag="config"
To subscribe model for activity log just use VJLau\ActivityLog\Loggable
use VJLau\ActivityLog\Loggable;
To add usage in your model
use Loggable;
To add middleware in your kernel
protected $routeMiddleware = [
......
'log.request' => \VJLau\ActivityLog\Middleware\LogAfterRequest::class,
];
https://github.com/leomarquine/activity-log - Activity Log for Laravel Eloquent Models
MIT - http://opensource.org/licenses/MIT