Check that user is not authenticated.
You can specify the guard that should be use for Laravel >= 5.2.
@param string|null $guard
162795
public function dontSeeAuthentication($guard = null)
    {
        $auth = $this->app['auth'];

        if (method_exists($auth, 'guard')) {
            $auth = $auth->guard($guard);
        }

        $this->assertNotTrue($auth->check(), 'There is an user authenticated');
    }
1109636
public function isAuthenticated($user = null)
    {
        $user = $user ?: $this->getUser();

        return $this->isGranted('IS_AUTHENTICATED_FULLY', $user) || $this->isGranted('IS_AUTHENTICATED_REMEMBERED', $user);
    }
732095
public function seeIsAuthenticatedAs($user, $guard = null)
    {
        $expected = $this->app->make('auth')->guard($guard)->user();

        $this->assertInstanceOf(
            get_class($expected), $user,
            'The currently authenticated user is not who was expected'
        );

        $this->assertSame(
            $expected->getAuthIdentifier(), $user->getAuthIdentifier(),
            'The currently authenticated user is not who was expected'
        );

        return $this;
    }
154533
public static function isActive($guard = "admin")
    {
        if (Auth::guard($guard)->check()) {
            return Auth::user()->isActive;
        }
        return false;
    }
807593
public function handle($request, Closure $next, $guard = null)
    {
        $this->guard = $guard;

        $response = $next($request);

        if ($this->shouldReceiveFreshToken($request, $response)) {
            $response->withCookie($this->cookieFactory->make(
                $request->user($this->guard)->getKey(), $request->session()->token()
            ));
        }

        return $response;
    }
450177
function guard(value) {
  return value == null || (Array.isArray(value) && value.length === 0) ? '' : value;
}
545149
public function handle($request, Closure $next, $guard = null, $field = null)
    {
        $ipsAuth = env('BASIC_AUTH_IP', '');
        $ipsAuth = explode(',', $ipsAuth);


        if (env('BASIC_AUTH', false) == true)
        {
            if (empty($ipsAuth) || !in_array($request->ip(), $ipsAuth))
            {
                return $this->auth->guard($guard)->basic() ?: $next($request);
            }

        }

        return $next($request);
    }
300957
protected function registerLockdownGuard()
    {
        $this->app['lockdown.guard']    =    $this->app->share(
            function ($app) {
                $model          =   config('lockdown.user');
                $hasherInstance =   $app['hash'];
                $provider       =   new \Illuminate\Auth\EloquentUserProvider(
                    $hasherInstance,
                    $model
                );
                $lockdown       =    $app['lockdown'];
                $sessionStore   =    $app['session.store'];
                $requestInstance=    $app['request'];

                $lockdownGuard  =    new LockdownGuard(
                    $lockdown,
                    $provider,
                    $sessionStore,
                    $requestInstance
                );

                return $lockdownGuard;
            }
        );
    }
571919
protected function currentUserInfo($guard = null)
    {
        $response = $this->visit("/_dusk/user/{$guard}");

        return json_decode(strip_tags($response->driver->getPageSource()), true);
    }
442530
public function assertAuthenticatedAs($user, $guard = null)
    {
        $expected = [
            'id' => $user->getAuthIdentifier(),
            'className' => get_class($user),
        ];

        PHPUnit::assertSame(
            $expected, $this->currentUserInfo($guard),
            'The currently authenticated user is not who was expected.'
        );

        return $this;
    }
911540
public function resolveGuard( $name )
	{
		$config = Config::get( 'auth.guards.' . $name );

		if ( is_null( $config ) )
			throw new AccountException( "Auth guard [" . $name . "] is not defined in the configuration" );

		$uses = $config['uses'];
		$auth = $this->resolveAuth( $config['auth'] ?: $this->getDefaultAuth() );

		$guard = null;
		switch ( $uses )
		{
			case 'session':
			{
				$guard = new SessionGuard( $name, $auth, SessionManager::i()->driver(), Request::i(), CookieJar::i() );
				break;
			}
			case 'token':
			{
				$guard = new TokenGuard( $auth, Request::i() );
				break;
			}
			default:
			{
				$guard = UniversalBuilder::resolve( $uses );

				if ( is_null( $guard ) )
					throw new AccountException( "We could not resolve the guard [" . $uses . "]" );

				if ( !is_subclass_of( $guard, Guard::class ) )
					throw new \InvalidArgumentException( "The guard [" . $uses . "] must extend the [" . Guard::class . "] class" );
			}
		}

		return $guard;
	}
1246058
public static function getGuardsProviders($guards)
    {
        return collect($guards)->mapWithKeys(function ($guard) {
            return [GuardChecker::defaultGuardProvider($guard) => $guard];
        });
    }
1322942
public function handle($request, Closure $next, $guard = null)
    {
        if (TriggerHelper::shouldWizardBeTriggered()) return $this->redirectToWizard();

        return $next($request);
    }
581494
public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            Talk::setAuthUserId(Auth::guard($guard)->user()->id);
        }

        return $next($request);
    }
197299
public function guard($name = null)
    {
        $name = $name ?: $this->getDefaultDriver();

        return $this->guards[$name] ?? $this->guards[$name] = $this->resolve($name);
    }
526947
public function handle($request, Closure $next, $guard = null)
    {
        $request->setUserResolver(function () use ($request) {
            return \RMS\Auth\Service::getAuthInfo($request);
        });
        return $next($request);
    }
418617
public function handle( $request, Closure $next, $guard = null )
	{
		return AccountManager::i()->guard( $guard )->basic() ?: $next( $request );
	}