Handle an incoming request.

@param  \Illuminate\Http\Request  $request
@param  \Closure  $next
@return mixed

@throws \Illuminate\Http\Exceptions\PostTooLargeException
546893
public function handle($request, Closure $next)
    {
        $max = $this->getPostMaxSize();

        if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
            throw new PostTooLargeException;
        }

        return $next($request);
    }
22310
public function handle($request, Closure $next)
    {
        if ($this->sessionConfigured()) {
            $request->setLaravelSession($this->startSession($request));
        }

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

        if ($response instanceof Response) {
            $response->isNotModified($request);
        }

        return $response;
    }
1163039
public function handle($request, Closure $next)
    {
        $guards = array_slice(func_get_args(), 2);

        $this->authenticate($guards);

        return $next($request);
    }
629197
public function handle($request, Closure $next)
    {
        if (!Config::get('lasallecmsusermanagement.auth_allow_users_to_log_into_front_end'))
        {
            return redirect()->back();
        }
        return $next($request);
    }
1197187
public function handle(Request $request, Closure $next)
    {
        $request::setTrustedProxies([$request->getClientIp()]);

        if (config('redirect.https', false) && !$request->secure())
        {
            return redirect()->secure($request->getRequestUri());
        }

        return $next($request);
    }
1218707
public function handle($request, Closure $next)
    {
        if (! in_array($this->auth->user()->role->id, $this->allowed_roles)) {
            return redirect()->route('admin.dashboard');
        }

        return $next($request);
    }
855416
public function handle($request, \Closure $next)
    {
        $this->filter->add(
            'body_class',
            $this->dispatchBodyClass($request->route())
        );

        return $next($request);
    }
873539
public function handle(Request $request, \Closure $next)
	{
		$this->buildRepository($request);

		return $next($request);
	}
1301372
public function handle($request, Closure $next)
    {
        if ( ! $this->auth->check()) {

            if ($request->ajax() || $request->wantsJson()) {
                return response('Unauthorized.', 401);
            } else {
                /** @var CoreInterface $core */
                $core = app(Component::CORE);

                return redirect()->route( $core->prefixRoute(NamedRoute::AUTH_LOGIN) );
            }
        }

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

        if ($this->isAResponseObject($response) && $this->isAnHtmlResponse($response)) {
            $output = $response->getContent();
            $minified = $this->html->render($output);
            $response->setContent($minified);
        }

        return $response;
    }
1202645
public function handle($request, Closure $next)
    {
        if ($this->cors->isPreflightRequest($request)) {
            return $this->cors->handlePreflightRequest($request);
        }

        return $next($request);
    }
1280234
public function handle($request, Closure $next)
    {
        if ($this->shouldExecute($request)) {
            return $this->before($request, $next);
        }

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

        return $next($request);
    }
464288
public function handle(Request $request, Closure $next)
    {
        // If the request URL is ignored from localization.
        if ($this->shouldIgnore($request)) return $next($request);

        $this->localization->setRouteNameFromRequest($request);

        return $next($request);
    }
1147038
public function handle($request, Closure $next)
    {
        if ($request->user() and $request->user()->id === $request->route('user')->id) {
            return $next($request);
        }

        if ($request->ajax() or $request->wantsJson()) {
            return response(
                __('common.error.403.message'), 403
            );
        }

        abort(403, __('common.error.403.message'), [
            'X-Robots-Tag' => 'noindex, nofollow',
        ]);
    }
8249
public function handle($request, Closure $next)
    {
        $request->merge($request->xml(true));
        
        return $next($request);
    }