limanweb/eloquent-logger
最新稳定版本:v1.0.5
Composer 安装命令:
composer require limanweb/eloquent-logger
包简介
Extensions for Laravel Eloquent\Model logging
README 文档
README
Installation
-
Run command to install a package into you project
composer require limanweb/eloquent-logger
-
Add package provider into
providerssection of yourconfig/app.php'providers' => [ ... \Limanweb\EloquentLogger\ServiceProvider::class, ],
-
Run command to publish package's config and migration
php artisan vendor:publish
and choise package \Limanweb\EloquentLogger\ServiceProvider to publish.
Now you have configuration file config/limanweb/eloquent_logger.php.
-
If you have changed user ID type to UUID in your project, then you must configure it in
usersection of configuration.'user' => [ ... 'key_cast' => 'string', 'key_create_method' => 'uuid', ],
-
Run migrate command.
php artisan migrate
-
In
App\Providers\EventServiceProvideradd next line to bottom ofboot()\Limanweb\EloquentLogger\LoggerService::initLogger();
Configuration
To turn on logger fore any model, add it into models section of configutarion.
'models' => [
...
App\AnyModel::class => [],
],
To exclude any model specified fields, add if into models.AnyModel.exclude_fields array of model declaration.
'models' => [
...
App\AnyModel::class => [
'exclude_fields' => [
'search',
],
],
],
To globally exclude any fields, add if into exclude_fields array of configutarion.
'exclude_fields' => [
'created_at',
'updated_at',
],
统计信息
- 总下载量: 4.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-05