php - Unauthorized even though I am authorized laravel
Get the solution ↓↓↓In my Profilepolicy, I have method viewAny
public function viewAny(User $user, Profile $profile){
return $user->id === $profile->user_id;
}
In my profile controller I have the gate above the view:
Gate::authorize('viewAny', $profile);
Now when I try to click my profile, it returns action is unauthorized.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: malformed utf-8 characters, possibly incorrectly encoded
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.