iferas93 / historiable-model
Laravel 模型历史跟踪
1.1.0
2020-06-05 20:42 UTC
Requires
- php: ^7.2.5
Requires (Dev)
- orchestra/canvas: ^5.4
- orchestra/testbench: ^5.3
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-09-06 07:14:38 UTC
README
轻松创建和显示您的模型历史记录的方法
安装
您可以通过composer安装此包
composer require iferas93/historiable-model
使用方法
此包创建 "histories" 表。使用以下命令发布迁移和配置文件:
php artisan historiable:install
之后,您可以在任何模型上添加 Histroiable 特性,如下所示:
use Iferas93\HistoriableModel\Traits\History\Histroiable;
class Artical extends Model
{
//this line for applying historiable to Article Model
use Historiable;
//this function for igonred cloumns from historiable
protected function ignoredColumns()
{
return [
'updated_at',
'slug'
];
}
}
您可以通过以下方式访问历史记录(变更日志)表:
http://domain.exmaple/changelog
测试
composer test
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
贡献
有关详细信息,请参阅 CONTRIBUTING。
安全
如果您发现任何与安全相关的问题,请通过电子邮件 ferasmo7mad@gmail.com 联系,而不是使用问题跟踪器。
致谢
许可协议
MIT 许可协议 (MIT)。有关更多信息,请参阅 许可文件。