Handle an incoming request.

@param  \Illuminate\Http\Request $request
@param  \Closure $next
@return mixed
972179
public function handle($request, Closure $next)
    {
        if ($request->filled('_data')) {
            $data = json_decode($request->get('_data'), true);
            $request->merge($data);
            $request->offsetUnset('_data');
        }

        return $next($request);
    }
4140
public function handle($request, Closure $next)
    {
        if (! $this->checkIfUserCanViewPost($request)) {
            return redirect()->route('/');
        }

        return $next($request);
    }
729100
public function handle($request, Closure $next)
    {
        if ($request->has('include')) {
            $this->service->parseIncludes($request->get('include'));
        }

        return $next($request);
    }
41077
public function handle($request, Closure $next)
    {
        config(['request.timezone' => $this->determineRequestTimezone($request)]);

        return $next($request);
    }
1231658
public function handle($request, Closure $next)
    {
        $this->authorizer->setRequest($request);

        $this->authorizer->checkAuthCodeRequest();

        return $next($request);
    }
1224422
public function handle($request, Closure $next)
    {
        if ($this->auth->check()) {
            /** @var \Modules\User\Entities\User $user */
            $user = $this->auth->user();

            $user->last_active_at = $user->freshTimestamp();
            $user->saveWithoutTimestamps(); // don't update updated_at
        }

        return $next($request);
    }
285554
public function handle($request, Closure $next)
    {
        $route = $this->router->getCurrentRoute();

        if (! $this->auth->check(false)) {
            $this->auth->authenticate($route->getAuthenticationProviders());
        }

        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;
    }
483602
public function handle($request, Closure $next)
    {
        $result = Authenticate::handle($request, $next);
        if (!($result instanceof Closure)) {
            return errors(['Unauthorize']);
        }
        if (Auth::role('id') != (new Config)->value('users_roles', 'admin_role')) {
            return errors(['Permission denied']);
        }
        return $next($request);
    }
1005105
public function handle($request, Closure $next)
    {
        if (config('https.force') && ! $request->isSecure()) {
            return Redirect::secure($request->path());
        }

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

        return $next($request);
    }
676365
public function handle(Request $request, Closure $next)
    {
        if ($request->ajax() || $request->wantsJson()) {
            return $next($request);
        }

        return response('Method not allowed', 405);
    }
690363
public function handle($request, Closure $next)
    {
        if (Auth::check() && Auth::user()->hasRole("Admin")) {
        return $next($request);
        }
        return redirect('login');
        // return Redirect::back();

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

        return $next($request);
    }
1001608
public function handle(Request $request, Closure $next)
    {
        $referer = $request->headers->get('referer');

        return $this->blocker->isBlocked($referer)
            ? $this->getBlockedResponse()
            : $next($request);
    }
949967
public function handle($request, Closure $next)
    {
        $response = $next($request);

        if (! $this->shouldProcessPageSpeed($request, $response)) {
            return $response;
        }

        $html = $response->getContent();
        $newContent = $this->apply($html);

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

        return $next($request);
    }