2017 © Pedro Peláez
 

library loggable

:This packages allows the laravel models to have automatic logging

image

tectiv3/loggable

:This packages allows the laravel models to have automatic logging

  • Monday, November 14, 2016
  • by tectiv3
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

loggable

Loggable is a Laravel 5 package which helps users to keep simple log of their model CRUD operations. ., (*1)

Installation

``` bash $ composer require tectiv3/loggable, (*2)


* Add the service provider to the providers array in app.php ``` bash 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

Usage

``` php //use Loggable in any of your models whose CRUD logs you want to keep use tectiv3\Loggable\Loggable; class DemoModel extends \Eloquent { use Loggable; }, (*3)

//for all logs loop through \tectiv3\Loggable\Log::all() or filter it however you like, (*4)

//for model specific logs you can call $model->logs to get model specific logs, (*5)

//then inside the loop you can access the user with ->user property, (*6)

foreach($model->logs as $log){ echo $log->entity . ' || ' . $log->action; echo '
'; echo 'By :'.$log->user->name.' at '.$log->created_at; } ```, (*7)

Credits

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

14/11 2016

dev-master

9999999-dev https://github.com/tectiv3/loggable

:This packages allows the laravel models to have automatic logging

  Sources   Download

MIT

The Requires

 

by Avatar tectiv3

laravel loggable logs