Level 88
Did you check the docs? I believe you miss a method in your User model
class User extends Model
{
public function canBeImpersonated()
{
return true;
}
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I get the following error
Call to undefined method Illuminate\Database\Query\Builder::canBeImpersonated() (View: /Users/me/laravel/resources/views/users/index.blade.php)
I use this package https://github.com/404labfr/laravel-impersonate
Did you check the docs? I believe you miss a method in your User model
class User extends Model
{
public function canBeImpersonated()
{
return true;
}
}
Please or to participate in this conversation.