Package Data | |
---|---|
Maintainer Username: | benjaminchen |
Maintainer Contact: | benjaminchen.c@gmail.com (benjamin) |
Package Create Date: | 2018-12-27 |
Package Last Update: | 2019-01-03 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-06 15:03:34 |
Package Statistics | |
---|---|
Total Downloads: | 50 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Installation via Composer:
composer require benjamin-chen/table-activity-record
Add the Service Provider in bootstrap/app.php
:
$app->register(BenjaminChen\TableActivityRecord\ServiceProvider::class);
Add env setting in .env
:
INFLUXDB_HOST=your-influx-db-host
INFLUXDB_PORT=8086
INFLUXDB_DATABASE=your-influx-db-database
Add operate logging channel
'channels' => [
'operate' => [
'driver' => 'daily',
'path' => storage_path('logs/operate/operate.log'),
]
],
Define model tags in model file:
class TestModel extends Model
{
...........
public $tags = [
'a', 'b', 'c'
];
}
Fire event after model executing create, update and delete methods
use BenjaminChen\TableActivityRecord\Events\TableActionEvent;
Event::fire(new TableActionEvent('create', $model));
Fire event will log your event data in storage/logs/operate/operate-yyyy-mm-dd.log
and store the event record at influx-db.
You can use command php artisan operateRecord:check
to check local log is the same with influx-db record
This package is open-source software and licensed under the MIT License.