Login laravel Trying to get property of non-object

Viewed 17281

I access to /admin and i get the redirect to /admin/login (that's normal, cause i'm not logged) but i can't see my view /admin/login.

I get this error:

Trying to get property of non-object
in VerifyCsrfToken.php (line 156)

If need code of some controller or something, write it please.

Thanks

Lines error:

$response->headers->setCookie(
        new Cookie(
            'XSRF-TOKEN', $request->session()->token(), Carbon::now()-
>getTimestamp() + 60 * $config['lifetime'],
            $config['path'], $config['domain'], $config['secure'], 
 false
        )
    );

Handler function on RedirectIfAuthenticated.php

    public function handle($request, Closure $next, $guard = null)
{

    switch($guard){
        case 'admin':
            if (Auth::guard($guard)->check()) {
                return redirect()->route('admin.dashboard');
            }
        break;

        default:
        if (Auth::guard($guard)->check()) {
            return redirect('/');
        }
        break;

    }
}
1 Answers
Related