We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having the following error "Call to undefined method Illuminate\Database\Query\Builder::check()" when using the said package.
This is what I've tried so far in my model:
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Notifications\Notifiable; use OwenIt\Auditing\Contracts\Auditable as AuditableContract; use OwenIt\Auditing\Auditable; use OwenIt\Auditing\Contracts\UserResolver; class Library extends Model implements AuditableContract, UserResolver { use Notifiable; use Auditable; protected $fillable = ['email']; protected $table = 'libraries'; public static function resolveId() { return User::check() ? User::user()->getAuthIdentifier() : null; } }
The text was updated successfully, but these errors were encountered:
Hi @mike23v,
As you can see in the Resolver part of the documentation, the resolver uses Auth, like so:
Auth
return Auth::check() ? Auth::user()->getAuthIdentifier() : null;
When in doubt, always check the docs. 😉
Sorry, something went wrong.
Hi @quetzyg ,
It something to do in the config/audit.php
'user' => [ 'primary_key' => 'id', 'foreign_key' => 'user_id', 'model' => App\User::class, 'resolver' => App\User::class, ],
When I try to change the 'resolver' to
'resolver' => function () { return Auth::check() ? Auth::user()->getAuthIdentifier() : null; },
it works fine. I believed you made some fix about this. It will work out if you return it to callable than using the FQCN. Thanks
Please, read the documentation. It's all there.
@quetzyg , Thanks for your help.
No branches or pull requests
Actual Behaviour
I'm having the following error
"Call to undefined method Illuminate\Database\Query\Builder::check()"
when using the said package.
This is what I've tried so far in my model:
The text was updated successfully, but these errors were encountered: