Handle an incoming request.

@param  \Illuminate\Http\Request  $request
@param  \Closure  $next
@param  string|null  $guard
@return  mixed
512505
public function handle($request, Closure $next, $guard = null)
    {
        $locale = $this->determinerManager->determineLocale($request);

        $this->app->setLocale($locale);

        return $next($request);
    }
805307
public function handle($request, Closure $next)
    {
        if( auth()->check() ) {
            $user = auth()->user();
            $user->updateLastActivity();
        }

        return $next($request);
    }
705378
public function handle($request, Closure $next)
    {
        if (!Sentinel::check()) {
            if ($request->expectsJson()) {
                $message = $this->translate('unauthorized', 'Unauthorized');
                return response()->json(['error' => $message], 401);
            } else {
                return redirect()->guest(route('auth.login.form'));
            }
        }

        return $next($request);
    }
1259985
public function handle(Request $request, Closure $next)
    {
        if ( ! $this->isAllowed())
            $this->failedAuthorization();

        return $next($request);
    }
1306936
public function handle($request, Closure $next)
    {
        if ($this->auth->parser()->setRequest($request)->hasToken()) {
            try {
                $this->auth->parseToken()->authenticate();
            } catch (Exception $e) {
                //
            }
        }

        return $next($request);
    }
274917
public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->guest()) {
            if ($request->ajax()) {
                return response('Unauthorized.', 401);
            } else {
                return redirect()->guest('login');
            }
        }

        return $next($request);
    }
305063
public function handle($request, Closure $next, $guard = null) {
		if (admin()->user()) {
			return redirect(aurl('/'));
		}
		return $next($request);

	}
252307
public function handle( $request, Closure $next, $guard = null )
	{
		if ( Acct::check() )
			return Redirect::to( '/' );

		return $next( $request );
	}
341479
public function handle( $request, Closure $next )
	{
		$response = $next( $request );

		foreach ( $this->cookies->getQueuedCookies() as $cookie )
			$response->headers->setCookie( $cookie );

		return $response;
	}
995406
public function handle($request, Closure $next)
    {
        if ( ! $this->auth->check()) {
            return cms_api()->response('Unauthorized.', 401);
        }

        return $next($request);
    }
776169
public function handle($request, Closure $next)
    {
        $route = $request->route();

        $this->router->substituteBindings($route);

        $this->substituteImplicitBindings($route);

        return $next($request);
    }
708997
public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            return response()->json(['error' => 'Already authenticated.'], 400);
        }

        return $next($request);
    }
890253
public function handle(Request $request, Closure $next)
    {
        if (!$this->service->isCorsRequest($request)) {
            return $next($request);
        }

        if ($this->service->isPreflightRequest($request)) {
            return $this->service->handlePreflightRequest($request);
        }

        return $this->service->handleRequest($request, $next($request));
    }
819991
public function handle(Request $request, \Closure $next)
    {
        if (!Merchant::user()) {
            return $next($request);
        }

        if (!Merchant::user()->allPermissions()->first(function ($permission) use ($request) {
            return $permission->shouldPassThrough($request);
        })) {
            \ShaoZeMing\Merchant\Auth\Permission::error();
        }

        return $next($request);
    }
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;
    }
751922
public function handle($request, \Closure $next)
    {
        try {
            $this->getOAuth2Service()->validateAccessToken();

            return $next($request);
        } catch (OAuthException $e) {
            return $this->accessDeniedResponse('ERROR.ACCESS_DENIED');
        }
    }
1351242
public function handle(Request $request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            if ($request->expectsJson()) {
                return response()->json(Auth::user());
            }

            return redirect()->route('admin.dashboard');
        }

        return $next($request);
    }