medicivn/eloquent-logger
最新稳定版本:v1.0.0
Composer 安装命令:
composer require medicivn/eloquent-logger
包简介
README 文档
README
Automatically update the logger when updating a model.
How to use:
- First, a root node must be initialized in your model's table
- Add
use ActivityLogTrait;to your eloquent model, example:
use Medicivn\EloquentLogger\ActivityLogTrait; class UserTest extends Model { use HasFactory, ActivityLogTrait; /** * The column need note write the change * * Default: [] */ const LOGGABLE = [ 'name', ]; /** * The model name to record changes * * Default: null */ const MODEL_NAME_LOG = ActivityUserTestLog::class;
Function
writeLog: write logger when changing data
Notes
- If you are using ActivityLogTrait for MySQL then create a table with the following columns
model_idurltimecreatorcreator_idactionkeyold_valuenew_value
统计信息
- 总下载量: 3.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-17