Forum

Laravel, authorizeR...
 
Notifications
Clear all

Laravel, authorizeResource, This action is unauthorized.

   RSS

0
Topic starter

policy not working?

1 Answer
0
Topic starter

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.

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: