Run the request filter.

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

@return mixed
777547
public function handle($request, Closure $next)
    {
        if (!Auth::check()) {
            return redirect()->route('laralum::login')->with('warning', 'You need to log in first');
        }

        $user = User::findOrFail(Auth::id());

        if (!$user->laralumAccess()) {
            return redirect('/')->with('error', 'You have no rights to enter this page');
        }

        foreach (Packages::all() as $package) {
            Injector::inject('laralum.auth', $package);
        }

        return $next($request);
    }
491073
public function handle($request, Closure $next)
    {
        $request->setTrustedProxies(['127.0.0.1', $request->server->get('REMOTE_ADDR')]);

        return $next($request);
    }
582320
public function handle($request, Closure $next)
    {

        if (!$request->isSecure() and env('SECURE_COOKIE', false)) {
            if (strpos($request->getRequestUri(), '/storage/') === false) {
                return redirect()->secure($request->getRequestUri());
            }

        }

        return $next($request);
    }
414210
public function handle($request, \Closure $next)
    {
        $token = $this->authenticate($request);
        $response = $next($request);

        if ($token) {
            $response->header('Authorization', 'Bearer ' . $token);
        }

        return $response;
    }
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);
    }
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);
    }
1165582
public function handle($request, Closure $next)
    {
        if (!$request->ajax()) {
            app(AnalyticsService::class)->log($request);
        }

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

        return $next($request);
    }
413051
public function handle($request, Closure $next)
    {
        if ($theme = $request->query('cms-theme')) {
            Theme::use($theme);
        }

        return $next($request);
    }
1000337
public function handle($request, Closure $next)
    {
        // unBind {locale} route parameter
        ! $request->route('locale') || $request->route()->forgetParameter('locale');

        return $next($request);
    }
1301486
public function handle($request, Closure $next)
    {
        if (!auth()->user()->isOwnerOfTeam(auth()->user()->currentTeam)) {
            return back();
        }

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

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

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

        $response = $next($request);

        $this->afterSendingThroughPipeline();

        return $response;
    }
889151
public function handle($request, Closure $next)
    {
        $modelName = $request->route()->parameter('model');
        if (! empty($modelName)) {
            $modelInst = CrudModel::createInstance($modelName);
            if (! $modelInst->checkAcl()) {
                if ($request->ajax() || $request->wantsJson()) {
                    return response('Unauthorized.', 401);
                } else {
                    return redirect()->guest('login');
                }
            }
        }

        return $next($request);
    }
953052
public function handle($request, Closure $next)
    {
        $locale = \LocaleHelper::getLocale();
        app()->setLocale($locale);

        return $next($request);
    }
1027237
public function handle($request, Closure $next)
    {
        $locale = $this->localizer->detect();

        if ($locale) {
            $this->localizer->store($locale);
        }

        return $next($request);
    }