carlosrgzm / activity-log
Register all user's information in your Laravel 5 application
Requires
- php: >=5.4.0
- laravel/framework: 5.*
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-12-19 02:31:31 UTC
README
Register all user's information in your Laravel 5 application.
Installation
- Add
carlosrgzm/activity-log
tocomposer.json
.
"carlosrgzm/activity-log": "1.0.*"
-
Run composer update to pull down the latest version.
-
Now open up app/config/app.php and add the service provider to your providers array.
'providers' => array( Carlosrgzm\ActivityLog\ActivityLogServiceProvider::class, ),
- Add the alias to the app.php section.
'aliases' => array( 'ActivityLog' => Carlosrgzm\ActivityLog\Models\ActivityLog::class,, ),
Configuration
Run php artisan vendor:publish
to generate the migrations and the configuration file in your config folder.
Usage
For using this package you can add this code in your templates
$act = new ActivityLog;
$data = new ActivityLogData($action, $contentType, $contentId, $details, $userId);
$act->log($data);
All params for ActivityLogData() are optional. The 'user_id' is automatically set to the current user if you have 'auto_set_user_id' => true in your activitylog.php config file.
You should review the config/activitylog.php to be sure all params are correct.