cybernerdie/laravel-model-activity-log
最新稳定版本:1.0.2
Composer 安装命令:
composer require cybernerdie/laravel-model-activity-log
包简介
A simple package to log model activities inside your laravel application
README 文档
README
This package logs model activities inside your Laravel application.
Installation
You can install the package via composer:
composer require cybernerdie/laravel-model-activity-log
You can publish the migrations with:
php artisan vendor:publish --provider="Cybernerdie\\ModelActivityLog\\ModelActivityLogServiceProvider"
You can run the migrations with:
php artisan migrate
Usage
Add the trait to your model and also import the class:
use RecordModelActivity;
Optionally, you can set the events to be recorded for your model:
protected static $eventsToRecord = ['created', 'updated'];
Optionally, you can add columns in your model that you want to ignore when events are recorded:
protected static $columnsToIgnore = ['email'];
Retrieve activities for a model:
$user = User::find(1); $activities = ModelActivityLog::subjectBy($user)->get();
Retrieve activities by event type:
$activities = ModelActivityLog::event('created')->get();
Retrieve changes for a specific activity:
$activities = ModelActivityLog::find(1)->changes();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-29