-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
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
Can't cache config #213
Comments
Hello @bram1028, Yeah, a If you have an idea on how to overcome this issue, feel free to discuss. I'll close this for now, though. |
A static method on the user model? |
The documentation will be updated shortly, but meanwhile here's what you have to do: Update the resolver configuration to use a FQCN instead of a return [
'user' = [
'resolver' => App\User::class,
],
]; Implement the <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\Auditable;
use OwenIt\Auditing\Contracts\Auditable as AuditableContract;
use OwenIt\Auditing\Contracts\UserResolver;
class User extends Model implements AuditableContract, UserResolver
{
use Auditable;
/**
* {@inheritdoc}
*/
public static function resolveId()
{
return Auth::check() ? Auth::user()->getAuthIdentifier() : null;
}
// ...
} |
Well, I know that will work great, but I'm having some other trouble with Thank you for this change! |
Found it! I didn't catch the filename change with v4... |
The framework will fail to boot when you cache the config with the new resolver closure:
compiles to:
The text was updated successfully, but these errors were encountered: