radosun's avatar

Guard Test

I am trying to get a set of gates to work in AuthServiceProvider, none are, so I decided to test out creating a completely open gate

Gate::define('open', function () { true; });

@can('open')

gate is open and working

@endcan

It does not work either, instead nothing displays... I am thinking if this gate doesn't work then no other gate in my application will either. Is this a valid base test or am I missing something?

0 likes
2 replies
Cronix's avatar
Cronix
Best Answer
Level 67

the gate needs to return a boolean to say whether it's allowed, or not. So, return true;

Please or to participate in this conversation.