I had a problem with adding policy authorizeResource method to a generated controller because the methods didn't use implicit binding. E.g. for model Site
public function show($id)
{
$site = Site::findOrFail($id);
return view('sites.show', compact('site'));
}
needed to be
public function show(Site $site)
{
return view('sites.show', compact('site'));
}
I had a problem with adding policy authorizeResource method to a generated controller because the methods didn't use implicit binding. E.g. for model Site
needed to be
Should you consider converting to latter convention, which would support the default policy stuff https://laravel.com/docs/6.x/authorization#via-controller-helpers ?