Logs for Laravel 5
290
0
3
Package Data
Maintainer Username: webmachine
Maintainer Contact: contacto@webmachine.cl (WebMachine)
Package Create Date: 2017-03-15
Package Last Update: 2022-03-21
Language: PHP
License: MIT
Last Refreshed: 2024-12-22 03:07:12
Package Statistics
Total Downloads: 290
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Logs for Laravel 5

Install

Via Composer

$ composer require webmachine/logs

Next, you must install the service provider and facade alias:

// config/app.php
'providers' => [
    ...
    Webmachine\Logs\LogsServiceProvider::class,
];

...

'aliases' => [
    ...
    'Logs' => Webmachine\Logs\LogsFacade::class,
];

Publish

$ php artisan vendor:publish --provider="Webmachine\Logs\LogsServiceProvider"

Usage

Add doer trait to user model

...
use Webmachine\Logs\Traits\LogDoer;

class User extends Model {
    use LogDoer;
    ...
}

Add traits to target models

...
use Webmachine\Logs\Traits\LogTarget;

class Foo extends Model {
    use LogTarget;
    ...
}

You can add a custom log description:

...
use Webmachine\Logs\LogsFacade as Logs;
...
public function storage() {
    ...
    Logs::setDescription('custom description');
    \App\Foo::create([...]);
}

License

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