Laravel, authorizeResource, This action is unauthorized.« Wróć do listy pytań

policy not working?
Wysłane przez mrmucha
Zadane przez 13/08/2018 09:22
0

Check parametrs of controller, if you see

1
public function show($id)
public function show($id)

then change if to

1
public function show(User $user)
public function show(User $user)

.

It’s required by Policy controller and their parameters

1
    public function view(User $user,User $model)
    public function view(User $user,User $model)

– as you see it’s using objects, not ID’s.

Wysłane przez mrmucha
Odpowiedziane 13/08/2018 09:24