2017 © Pedro Peláez
 

library action-log

A laravel package of ActionLog

image

qylinfly/action-log

A laravel package of ActionLog

  • Tuesday, March 27, 2018
  • by QylinFly
  • Repository
  • 1 Watchers
  • 1 Stars
  • 185 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 13 Versions
  • 8 % Grown

The README.md

action-log

Laravel 5 The operation log is automatically recorded, (*1)

Installation

The ActionLog Service Provider can be installed via Composer by requiring the qylinfly/action-log package and setting the minimum-stability to dev (required for Laravel 5) in your project's composer.json., (*2)

{
    "require": {

        "qylinfly/action-log": "2.0.*"
    },
    ...
}

or, (*3)

Require this package with composer:, (*4)

composer require qylinfly/action-log 

Update your packages with composer update or install with composer install., (*5)

Usage

To use the ActionLog Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this., (*6)

Find the providers key in config/app.php and register the ActionLog Service Provider., (*7)

    'providers' => [
        // ...
        'Qylinfly\ActionLog\ActionLogServiceProvider',
    ]

for Laravel 5.1+, (*8)

    'providers' => [
        // ...
        Qylinfly\ActionLog\ActionLogServiceProvider::class,
    ]

Find the aliases key in config/app.php., (*9)

    'aliases' => [
        // ...
        'ActionLog' => 'Qylinfly\ActionLog\Facades\ActionLogFacade',
    ]

for Laravel 5.1+, (*10)

    'aliases' => [
        // ...
        'ActionLog' => Qylinfly\ActionLog\Facades\ActionLogFacade::class,
    ]

Configuration

You can publish the migration with:, (*11)

php artisan vendor:publish --provider="Qylinfly\ActionLog\ActionLogServiceProvider" --tag="migrations"

The package assumes that your users table name is called "users". If this is not the case you should manually edit the published migration to use your custom table name., (*12)

After the migration has been published you can create the role- and permission-tables by running the migrations:, (*13)

php artisan migrate

You can publish the config-file with:, (*14)

php artisan vendor:publish --provider="Qylinfly\ActionLog\ActionLogServiceProvider" --tag="config"

To use your own settings, publish config. config/actionlog.php, (*15)

return [
    //Middleware which records the request method
    'request_methods'=>['POST','GET'],
    //Fill in the name of the model to be logged, which can be multiple
    'models'=>['\App\User'],
    //Whether it is open
    'enable'=>true
];

Demo

Automatically record the operation log, the database operation should be as follows:, (*16)


update $users = Users::find(1); $users->name = "myname"; $users->save(); add $users = new Users(); $users->name = "myname"; $users->save() delete Users:destroy(1);

Active log operation log - Custom record user access, (*17)


use ActionLog ActionLog::createActionLog($type,$content);

Middleware - The middleware automatically records user access, (*18)

class Kernel extends HttpKernel
{
    protected $middleware = [
       \Qylinfly\ActionLog\Middleware\UserActionLog::class
    ];
     ...
}

The Versions

27/03 2018

dev-master

9999999-dev

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

27/03 2018

2.1.0

2.1.0.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

28/08 2017

2.0.5

2.0.5.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

30/03 2017

2.0.4

2.0.4.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

30/03 2017

2.0.3

2.0.3.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

29/03 2017

2.0.2

2.0.2.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

27/03 2017

2.0.1

2.0.1.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

27/03 2017

2.0.0

2.0.0.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

27/03 2017

1.1.3

1.1.3.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

27/03 2017

1.1.2

1.1.2.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

15/03 2017

1.1.1

1.1.1.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar QylinFly

laravel actionlog

08/07 2016

1.1

1.1.0.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar luoyangpeng

laravel actionlog

08/07 2016

1.0

1.0.0.0

A laravel package of ActionLog

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar luoyangpeng

laravel actionlog