Answer the question
In order to leave comments, you need to log in
Can anyone explain the sample closure from the docs on creating a custom guard for Auth?
I decided to remake the custom guard from anonymous (Auth::viaRequest) to normal, but I don’t understand the sample in the dock:
Auth::extend('jwt', function ($app, $name, array $config) {
// Возвращаем экземпляр `Illuminate\Contracts\Auth\Guard` ...
return new JwtGuard(Auth::createUserProvider($config['provider']));
});
Auth::extend('myguard', function() {
return new MyGuard();
});
Answer the question
In order to leave comments, you need to log in
By the method of scientific poke, it was found that:
Auth::extend('myguard', function() {
return new MyGuard();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question