2017 © Pedro Peláez
 

library laravel-action-log

A laravel package for logging user actions into the database

image

scolib/laravel-action-log

A laravel package for logging user actions into the database

  • Thursday, April 19, 2018
  • by klgd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 830 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Laravel Action Log

StyleCI ![Latest Version on Packagist][ico-version] Software License ![Build Status][ico-travis] Coverage Status ![Quality Score][ico-code-quality] Total Downloads, (*1)

Install

Laravel 5.5.*

``` bash $ composer require scolib/laravel-action-log:1.3.*, (*2)


Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider. ### Laravel 5.4.* ``` bash $ composer require scolib/laravel-action-log:1.2.*

Add the ServiceProvider to the providers array in config/app.php, (*3)

\Sco\ActionLog\LaravelServiceProvider::class,

If you want to use the facade to logging actions, add this to the aliases array in config/app.php, (*4)

'ActionLog' => Sco\ActionLog\Facade::class,

Publish config file

Copy the package config to your local config with the publish command:, (*5)

php artisan vendor:publish --provider="Sco\ActionLog\LaravelServiceProvider"

Default action log table name is action_logs, If you want to customize it, edit the config/actionlog.php, (*6)

Now run the artisan migrate command:, (*7)

php artisan migrate

Usage

Method 1

Override the property $events in your Model, (*8)

    protected $events = [
        'created'  => \Sco\ActionLog\Events\ModelWasCreated::class,
    ];

⚠ Note: Laravel 5.5
Renamed $events to $dispatchesEvents (#17961, b6472bf, 3dbe12f), (*9)

All available event, (*10)

[
    'created'   => \Sco\ActionLog\Events\ModelWasCreated::class,
    'deleted'   => \Sco\ActionLog\Events\ModelWasDeleted::class,
    'restored'  => \Sco\ActionLog\Events\ModelWasRestored::class,
    'saved'     => \Sco\ActionLog\Events\ModelWasSaved::class,
    'updated'   => \Sco\ActionLog\Events\ModelWasUpdated::class,
    'creating'  => \Sco\ActionLog\Events\ModelWillCreating::class,
    'deleting'  => \Sco\ActionLog\Events\ModelWillDeleting::class,
    'restoring' => \Sco\ActionLog\Events\ModelWillRestoring::class,
    'saving'    => \Sco\ActionLog\Events\ModelWillSaving::class,
    'updating'  => \Sco\ActionLog\Events\ModelWillUpdating::class,
]

Method 2

Manual logging actions, (*11)

// use event
event(new \Sco\ActionLog\Events\ManualEvent($type, $content));

// use factory
\Sco\ActionLog\Factory::info(LogInfo $info);

Change log

Please see CHANGELOG for more information on what has changed recently., (*12)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*13)

Security

If you discover any security related issues, please email slice1213@gmail.com instead of using the issue tracker., (*14)

Credits

License

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

The Versions

19/04 2018

dev-master

9999999-dev https://github.com/ScoLib/laravel-action-log

A laravel package for logging user actions into the database

  Sources   Download

MIT

The Requires

 

The Development Requires

scolib laravel-action-log

12/09 2017
02/09 2017
11/06 2017

1.2.x-dev

1.2.9999999.9999999-dev https://github.com/ScoLib/laravel-action-log

A laravel package for logging user actions into the database

  Sources   Download

MIT

The Requires

 

The Development Requires

scolib laravel-action-log

11/06 2017
08/05 2017

v1.2.0

1.2.0.0 https://github.com/ScoLib/laravel-action-log

A laravel package for logging user actions into the database

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

scolib laravel-action-log

28/04 2017

v1.0.1

1.0.1.0 https://github.com/ScoLib/laravel-action-log

A laravel package for logging user actions into the database

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

scolib laravel-action-log

28/04 2017

v1.0.0

1.0.0.0 https://github.com/ScoLib/laravel-action-log

A laravel package for logging user actions into the database

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

scolib laravel-action-log