This laravel 5 package provides to log the activity of the users
siduko/laravel-activitylog is a Laravel package for this laravel 5 package provides to log the activity of the users.
It currently has 0 GitHub stars and 7 downloads on Packagist.
Install it with composer require siduko/laravel-activitylog.
Discover more Laravel packages by siduko
or browse all Laravel packages to compare alternatives.
Last updated
This laravel 5 package provides to log the activity of users. It can also automatically log model events, custom message log. You can custom log handler to saving another destination Unless you can use built in handler as EloquentHandler (using database ) or LogHandler (using log)
Via Composer
$ composer require siduko/laravel-activitylog
Or add composer.json
"require": {
'...',
"siduko/laravel-activitylog":"v1.0-dev"
}
Install the service provider to config.php
// config/app.php
'providers' => [
'...',
\LaiVu\ActivityLog\ActivityLogServiceProvider::class,
],
'aliases' => [
'...',
'ActivityLog'=>\LaiVu\ActivityLog\ActivityLogFacade::class,
],
You can publish the migration with:
php artisan vendor:publish --provider="LaiVu\ActivityLog\ActivityLogServiceProvider" --tag="migrations"
After you run migration
php artisan migrate
You can optionally publish the config file with:
php artisan vendor:publish --provider="LaiVu\ActivityLog\ActivityLogServiceProvider" --tag="config"
Default config
<?php
/**
* Created by PhpStorm.
* User: Lai Vu
* Date: 10/24/2016
* Time: 3:52 PM
*/
return [
/***
* When set to true, activity log will be active
*/
'enabled' => env('ACTIVITY_LOGGER_ENABLED', true),
'activity_model' => '\LaiVu\ActivityLog\Models\Activity',
'default_log_name' => 'default',
/***
* Default activity log handle, using to setting log handler
* You can custom a handler and set to here
* Example:
* 'default' => ['eloquent','log','custom']
*/
'default' => ['eloquent'],
/**
* When set to true, the subject returns soft deleted models.
*/
'subject_returns_soft_deleted_models' => false,
'delete_records_older_than_days' => 365,
/***
* List log handlers, you can add new custom handler
* `driver` is classpath of log handler
*/
'handlers' => [
'log' => [
'driver' => '\LaiVu\ActivityLog\Handlers\LogHandler'
],
'eloquent' => [
'driver' => '\LaiVu\ActivityLog\Handlers\EloquentHandler'
]
]
];
This is the most basic way to log activity:
activity()->log('Look mum, I logged something');
Or
ActivityLog::log('Look mum, I logged something');
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.