New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

tectiv3/loggable

:This packages allows the laravel models to have automatic logging
6
Install
composer require tectiv3/loggable:dev-master
PHP:>=5.4.0
License:MIT
Last Updated:Feb 7, 2019
Links: GitHub  ·  Packagist
Maintainer: tectiv3

loggable

Loggable is a Laravel 5 package which helps users to keep simple log of their model CRUD operations. .

Installation

$ composer require tectiv3/loggable
  • Add the service provider to the providers array in app.php
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

//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;
}

Credits

License

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

Related Packages

themightysapien/loggable

:This packages allows the laravel models to have automatic logging

22 1
webmachine/logs

Logs for Laravel 5

401 0
metalcoder/logsifier

Package to manage application logs

29 0
aryehraber/statamic-logbook

Manage and view log files in the CP.

244,352 9
dreamfactory/df-mongo-logs

DreamFactory(tm) MongoDB Logger Package

26,961 0