Package Data | |
---|---|
Maintainer Username: | tectiv3 |
Package Create Date: | 2016-09-29 |
Package Last Update: | 2019-02-07 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-23 03:27:12 |
Package Statistics | |
---|---|
Total Downloads: | 6 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Loggable is a Laravel 5 package which helps users to keep simple log of their model CRUD operations. .
$ composer require tectiv3/loggable
tectiv3\Loggable\ServiceProvider::class
//Then do vendor:publish from the artisan command to copy the migration file and run migrate command
php artisan vendor:publish --provider="tectiv3\Loggable\ServiceProvider"
php artisan migrate
//use Loggable in any of your models whose CRUD logs you want to keep
use tectiv3\Loggable\Loggable;
class DemoModel extends \Eloquent {
use Loggable;
}
//for all logs loop through \tectiv3\Loggable\Log::all() or filter it however you like
//for model specific logs you can call $model->logs to get model specific logs
//then inside the loop you can access the user with ->user property
foreach($model->logs as $log){
echo $log->entity . ' || ' . $log->action;
echo '<br>';
echo 'By :'.$log->user->name.' at '.$log->created_at;
}
The MIT License (MIT). Please see License File for more information.