asd-lt/action-log
Composer 安装命令:
composer require asd-lt/action-log
包简介
Laravel library for logging desired column changes in models
README 文档
README
Laravel library for logging desired column changes in models
Installation
Use the package manager composer to install Action log.
composer require asd-lt/action-log
Copy migration
php artisan action-log:tables
Run migrations
php artisan migrate
Configuration & Usage
Default guard will be used to link user with log, or it can be defined in auth.php configuration file.
'defaults' => [ // ... 'action_log_guard' => 'guard', ],
Attach action log trait to any model, which changes should be logged.
use Asd\ActionLog\Models\Traits\ActionLogTrait; class Model { use ActionLogTrait; // ... }
By default, all columns defined in fillable model attribute will be logged, but if needed it can be limited with additional model attribute loggableFields
class Model { // log only these column changes protected $loggableFields = [ 'column1', 'column2', ]; }
Additionally, columns can be excluded from logging.
class Model { // exclude columns from logging changes protected $actionLogAttributesExcept = [ 'column3', 'column4', ]; }
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
统计信息
- 总下载量: 1.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-24