Forum

Laravel, authorizeR...
 
Notifications
Clear all

Laravel, authorizeResource, This action is unauthorized.

1 Posty
1 Users
0 Reactions
1,483 Widok
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: