rollswan/audit-trail

A library package used to logs activities/transactions made in your application.

1.0.12 2021-09-08 14:41 UTC

This package is auto-updated.

Last update: 2024-04-08 20:07:39 UTC


README

A library package used to logs activities/transactions made in your web application.

Installation

  1. Run in terminal:
composer require rollswan/audit-trail
  1. Register the package
  • Laravel 5.5 and up
    Uses package auto discovery feature, no need to edit the config/app.php file.

  • Laravel 5.4 and below
    Register the package with laravel in config/app.php under providers with the following:

'providers' => [
    Rollswan\AuditTrail\Providers\AuditTrailServiceProvider::class,
];
  1. Migrate audit_trails table by running:
php artisan migrate
  1. Publish config file by running:
php artisan vendor:publish --provider="Rollswan\AuditTrail\Providers\AuditTrailServiceProvider"
php artisan vendor:publish --tag="audit-trail"

How to use?

  1. Use audit-trail via middleware
Route::group(['middleware' => ['web', 'audit-trail']], function () {
    Route::get('/dashboard', 'HomeController@index')->name('dashboard');
});