79600989

Date: 2025-04-30 19:35:18
Score: 0.5
Natty:
Report link

When you call the authorize method in your controller, you are passing the policy as the argument instead of the user class/model as defined in your policy in the view method. You should obtain the user first in your controller and pass it as the second argument in your $this->authorize() method. This could be something along the lines of in your controller

$user = auth()->user();

this->authorize('view', $user);

// rest of the code
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (0.5):
Posted by: Olumuyiwa