I am trying to access auth()->user() in controller constructor, but it always return null
.
I have tried below, but no luck!
protected $user;
function __construct() {
$this->middleware(function ($request, $next) {
$this->user = auth()->user();
return $next($request);
});
}
Is there any way to do this?
--Thanks