Answer the question
In order to leave comments, you need to log in
How to get the admin session data in the controller?
It was necessary to make an if(Auth::user()->isAdmin()) condition in the Http controller and it turned out that user = null. There is a session token, @role is displayed in templates. I can not understand: what is needed in order to get session data? I can't even get my login.
public function __construct()
{
if (config(....)) - это то, что сейчас работает и я хочу заменить на Auth:user()->role('Admin')
$this->middleware('auth.basic');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question