Support the ongoing development of Laravel.io →
Authentication Architecture

Hi everybody!

I defined an ability in AuthServiceProvider and it always returned false because i use custom guard. I could solve this problem, I put this code in admin middleware: Auth::shouldUse('admin') .

Now if I define an ability in AuthServiceProvider the Gate methods are working, but if I define ability in policy class the gate methods always return false. Can anyone help me?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jzsolti jzsolti Joined 25 Oct 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.