devpartners / 可审计日志
一个用于显示 Laravel Auditing 审计日志的 Laravel Nova 资源工具。
v2.0.2
2022-06-03 14:20 UTC
Requires
- php: >=7.1.0
Suggests
- owen-it/laravel-auditing: Provides the necessary functionality to audit your Eloquent models
README
Laravel Nova 资源工具,允许您轻松显示由 Laravel Auditing 包 (owen-it/laravel-auditing) 创建的审计日志。
安装
使用 composer 简单安装。
composer require devpartners/auditable-log
然后将资源工具添加到使用并实现 Laravel Auditable 包的模型的相关资源中。
public function fields(Request $request) { return [ Text::make('Name'), Text::make('E-mail'), // Shows audit log button on detail view, which expands audit trail AuditableLog::make() ]; }
Laravel Nova 3.x
此包的最新版本 (^2.0) 与 Laravel Nova 4 兼容。如果您需要 Laravel Nova 3 的支持,请使用版本 ^1.0。
策略
有两组策略门可用于在资源的策略中实现。
// Is the user able to access the audit log for this resource? public function audit($loggedInUser, $resource) { return true; }
// Is the user able to restore values based on audits for this resource? public function audit_restore($loggedInUser, $resource) { return true; }