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-11-14 15:07:26 |
Package Statistics | |
---|---|
Total Downloads: | 290 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
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"
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([...]);
}
The MIT License (MIT). Please see License File for more information.