我正在使用 Laravel 5.4 和 Laravel Auditing 4.1。我想记录 Variant 模型的价格变化,我安装了 Auditing 4.1 包。看我的代码,
配置/审计.php
'implementation' => OwenIt\Auditing\Models\Audit::class,
'user' => [
'primary_key' => 'id',
'foreign_key' => 'variant_id',
'model' => App\Variant::class,
'resolver' => App\Variant::class,
],
应用程序/模型/Variant.php
use OwenIt\Auditing\Auditable;
use OwenIt\Auditing\Contracts\Auditable as AuditableContract;
class Variant extends BaseModel implements AuditableContract{
use Auditable;
--------Code here----------------
}
当我尝试将数据插入数据库时使用此代码,会出现此错误,
UnexpectedValueException
Invalid User resolver, callable or UserResolver FQCN expected
如何修复此错误并在audits
表格上记录我的更改?