mintbridge/eloquent-auditing
Composer 安装命令:
composer require mintbridge/eloquent-auditing
包简介
An eloquent package for recording model events to a database
README 文档
README
This Laravel 5 package allows model events to be logged to a database. It provides a trait that can be added to any Eloquent model allowing for chosen events to be logged using a polymorphic relationship.
Installation
This package can be installed through Composer.
composer require mintbridge/eloquent-auditing
Once installed add the service provider and facade to your app config
// config/app.php 'providers' => [ '...', Mintbridge\EloquentAuditing\AuditServiceProvider::class, ]; 'aliases' => [ ... 'Auditor' => Mintbridge\EloquentAuditing\AuditorFacade::class, ];
You'll also need to publish and run the migration in order to create the database table.
php artisan vendor:publish --provider="Mintbridge\EloquentAuditing\AuditServiceProvider" --tag="config"
php artisan vendor:publish --provider="Mintbridge\EloquentAuditing\AuditServiceProvider" --tag="migrations"
php artisan migrate
The configuration will be written to config/auditing.php. The options have sensible defaults but you should change the user to match the one used in your application.
Usage
This package will record the events from your models. To do so your model must use the Auditable trait and implement AuditableInterface.
use Mintbridge\EloquentAuditing\Auditable; use Mintbridge\EloquentAuditing\AuditableInterface; class Article extends Eloquent implements AuditableInterface { use Auditable; ...
The trait by default will use the event in config/auditing.php but you can overide this on a per model basis by adding a static $auditableEvents array of event names to the model. See http://laravel.com/docs/5.1/eloquent#events for the available events.
use Mintbridge\EloquentAuditing\Auditable; use Mintbridge\EloquentAuditing\AuditableInterface; class Article extends Eloquent implements AuditableInterface { use Auditable; public static $auditableEvents = [ 'creating', 'created', 'updating', //... ]; ...
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
mintbridge/eloquent-auditing 适用场景与选型建议
mintbridge/eloquent-auditing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.58k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 12 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Audit」 「laravel」 「auditing」 「eloquent」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mintbridge/eloquent-auditing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mintbridge/eloquent-auditing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mintbridge/eloquent-auditing 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Log adding/updating/deleting of elements
Doctrine ORM provider for the auditor audit-log library.
PB Web Media Audit Bundle for Symfony
Pop Audit Component for Pop PHP Framework
A Laravel Nova tool for managing Spatie roles and permissions with optional audit logging.
Simplest Auditable for Laravel Eloquent/Model
统计信息
- 总下载量: 6.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-06