Laravel5.3 - controller auth problems

Posted 2 years ago by [email protected]

Hi,

I have an error after upgrading my project to 5.3. I am sharing the user across all my controllers and views, however now Im getting null. This is my code

/**
     * BaseController constructor.
     */
    public function __construct()
    {
        $this->user = \Auth::user();

        view()->share('user', $this->user);
    }

I think at this point the AuthManager has not been executed (Actually, it is being executed event before the middleware) . I have dumped my code in the controller (null value) and in the middleware (Auth::User() does actually have the user object).

Was it any change in the bootstrap order or am I missing any other change for the upgrade?

Thanks,

Please sign in or create an account to participate in this conversation.