Hello @robg
What you described is what the documentation called Guest Users ( https://laravel.com/docs/10.x/authorization#guest-users ) The function need to get the user but it can nullable.
That means the policy view function should be:
public function view(?User $user, Page $model): bool
{
dd(__METHOD__);
return true;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community