Handle an incoming request.

@param  \Illuminate\Http\Request $request
@param  \Closure $next
@return mixed
507341
public function handle($request, Closure $next)
    {
        /** @var Response $response */
        $response = $next($request);

        if ($request->isMethod('get')) {
            // Generate Etag
            $etag = md5($response->getContent());

            $requestEtag = str_replace('"', '', $request->getETags());
            // Check to see if Etag has changed
            if ($requestEtag && $requestEtag[0] == $etag) {
                $response->setNotModified();
            }

            // Set Etag
            $response->setEtag($etag);
        }

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

        return $next($request);
    }
508632
public function handle($request, Closure $next)
    {
        $containers = $this->session->get($this->key, []);

        if (count($containers) > 0) {
            foreach ($containers as $name => $messages) {
                /** @var \Krucas\Notification\Message $message */
                foreach ($messages as $message) {
                    $this->notification->container($name)->add($message->getType(), $message, false);
                }
            }
        }

        $this->session->forget($this->key);

        return $next($request);
    }
1254984
public function handle($request, Closure $next)
    {
        if ($this->auth->check() && $this->auth->viaRemember()) {
            $ip = $request->getClientIp();

            $this->updateFields($this->auth, $ip);
        }

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

    }
635269
public function handle(Request $request, Closure $next)
    {
        /** @var Response $response */
        $response = $next($request);

        if ($this->stack->count() > 0) {
            $dumped = \implode(\PHP_EOL, $this->stack->all());

            $this->stack->clear();

            $response->setContent($dumped . $response->getContent());
        }

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

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

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

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

        return $next($request);
    }
1119153
public function handle(Request $request, Closure $next)
    {
        $request = $this->processRequest($request);
        return $next($request);
    }
78396
public function handle($request, Closure $next)
    {
        if (!Sentinel::check() || !Sentinel::inRole('admin')) {
            if ($request->ajax()) {
                return response('Unauthorized.', 401);
            } else {
                return Redirect::route('login');
            }
        }
        return $next($request);
    }
166804
public function handle(Request $request, Closure $next)
    {
        $request->attributes->add(['responsecache.doNotCache' => true]);

        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;
	}
637419
public function handle($request, Closure $next)
    {
        $route  = $this->container->make(Route::class);
        $binder = $this->container->make(RouteBinderRegister::class);

        $binder->substituteBindings($route);

        return $next($request);
    }
200149
public function handle($request, Closure $next)
    {
        if (!$this->debugbar->isEnabled()) {
            abort(404);
        }

        return $next($request);

    }