I am working on a Laravel 10 on Visual Studio Code with intelephense extension installed. I am getting error on my policy classes saying,
"Expected type 'bool'. Found 'Illuminate\Auth\Access\Response'.intelephense(1006)"
Here is a portion of my code:
public function create(User $user): bool
{
$roles = $user->roles->pluck('id')->toArray();
return in_array(Role::TRAINING_MANAGER, $roles)
? Response::allow()
: Response::deny();
}
How to get ride of this error notification?
Update
I should have changed the return type to Response.