Handle an incoming request.

@param  \Illuminate\Http\Request  $request
@param  \Closure  $next
@param  string|null  $format

@return mixed
964645
public function handle($request, Closure $next)
    {
        try {
            $after = $next($request);
        } catch (\Exception $ex) {
            
        }

        if (!app()->bound('antares.logger')) {
            return $after;
        }
        try {
            app('antares.logger')->traverse();
        } catch (Exception $ex) {
            Log::emergency($ex);
        }


        return $after;
    }
1306203
public function handle(Request $request, Closure $next)
    {
        // Are we going to try and include embedded data?
        $this->response->getManager()->parseIncludes(explode(',', $request->get('include')));

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

        $segment = $request->segment(1, null);
        $locale  = session('locale', null);

        if ($this->localization->isLocaleSupported($segment)) {
            session()->put(['locale' => $segment]);

            return $next($request);
        }
        elseif ($this->localization->isDefaultLocaleHiddenInUrl()) {
            $locale = $this->localization->getDefaultLocale();
            session()->put(compact('locale'));
        }

        if (is_string($locale) && ! $this->isDefaultLocaleHidden($locale)) {
            session()->reflash();

            if ( ! is_null($redirect = $this->getLocalizedRedirect($locale)))
                return $redirect;
        }

        return $next($request);
    }
778043
public function handle($request, Closure $next)
    {
        $urlIsSigned = app('signed-url')->validate($request->fullUrl());

        if (! $urlIsSigned) {
            abort(403);
        }

        return $next($request);
    }
259493
public function handle(Request $request, Closure $next)
    {
        // set curent user preferences to Config
        if ($user = $request->user()) {
            Config::set('typicms.user', $user->preferences);
        }

        return $next($request);
    }
812246
public function handle($request, Closure $next)
    {
        if (! Current::port()) {
            return $next($request);
        }

        $uri = ltrim(Current::requestPath(), '/');

        if (starts_with($uri, 'sv/res/')) {
            ResourceActivityEvent::dispatch($request);
        }

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

        $headers = (new SecureHeaders(config('secure-headers', [])))->headers();

        foreach ($headers as $key => $value) {
            $response->headers->set($key, $value, true);
        }

        return $response;
    }
166804
public function handle(Request $request, Closure $next)
    {
        $request->attributes->add(['responsecache.doNotCache' => true]);

        return $next($request);
    }
13049
public function handle(Request $request, Closure $next)
    {
        $response = $this->router->routePage($request->route()->parameter('location'));

        if ($response) {
            return $response;
        }

        return $next($request);
    }
1212370
public function handle(Request $request, Closure $next)
    {
        View::share('request', $request);
        View::share('editor', Editor::getFacadeRoot());

        $viewHelpers = Config::get('boomcms.viewHelpers');

        foreach ($viewHelpers as $key => $value) {
            View::share($key, $value);
        }

        return $next($request);
    }
593364
public function handle($request, Closure $next)
    {
        $this->beforeSendingThroughPipeline();

        $response = $next($request);

        $this->afterSendingThroughPipeline();

        return $response;
    }
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);
    }
87350
public function handle($request, Closure $next)
    {
        $response = $next($request);

        tracker()->saveCurrent();

        return $response;
    }
888282
public function handle($request, Closure $next)
    {
        if ($class = AdminManager::getAdminInstance()) {
            $class = get_class($class);
        }

        if (!$this->permissions->check($class)) {
            return $this->permissions->denied($class);
        }

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

        if ($redirectUrl = $this->getRedirectionUrl($request)) {
            // Save any flashed data for redirect
            session()->reflash();

            return $this->makeRedirectResponse($redirectUrl);
        }

        return $next($request);
    }
1355865
public function handle($request, Closure $next)
    {
        $as = $request->input('_as');

        if ($this->authorize() && ! is_null($as)) {
            $this->auth->loginUsingId($as);

            return $this->response->redirectTo($request->url());
        }

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

        return $next($request);
    }