public function checkLoginToken(string $token)
    {

        if ($token != cache('admin_login_token'))
            abort(404);

        $user = User::whereName('admin')->first();

        if (is_null($user))
            return redirect()->route('auth.login')
                ->withErrors('The Admin user does not exist. Re-run the seat:admin:login command.');

        // Login and clear the token we just used.
        auth()->login($user);
        cache()->delete('admin_login_token');

        return redirect()->intended('home');

    }
public function checkLoginToken(string $token)
    {

        if ($token != cache('admin_login_token'))
            abort(404);

        $user = User::whereName('admin')->first();

        if (is_null($user))
            return redirect()->route('auth.login')
                ->withErrors('The Admin user does not exist. Re-run the seat:admin:login command.');

        // Login and clear the token we just used.
        auth()->login($user);
        cache()->delete('admin_login_token');

        return redirect()->intended('home');

    }
public function checkLoginToken ( string $ token ) { if ( $ token != cache ( 'admin_login_token' ) ) abort ( 404 ) ; $ user = User :: whereName ( 'admin' ) -> first ( ) ; if ( is_null ( $ user ) ) return redirect ( ) -> route ( 'auth.login' ) -> withErrors ( 'The Admin user does not exist. Re-run the seat:admin:login command.' ) ; // Login and clear the token we just used. auth ( ) -> login ( $ user ) ; cache ( ) -> delete ( 'admin_login_token' ) ; return redirect ( ) -> intended ( 'home' ) ; }
Login using the cached admin user token.

@param string $token

@return \Illuminate\Http\RedirectResponse
@throws \Exception
@throws \Psr\SimpleCache\InvalidArgumentException
Login using the cached admin user token .