Handle an incoming request.

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

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

        if ($response) {
            return $response;
        }

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

        return $next($request);
    }
463485
public function handle($request, \Closure $next)
    {
        $route = $request->route();

        if ($route->hasCondition()) {
            $this->router->addWordPressBindings($route);
        }

        return $next($request);
    }
1054986
public function handle($request, Closure $next)
    {
        $this->credentials->getThrottleProvider()->enable();

        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);
    }
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);
    }
95532
public function handle($request, Closure $next)
    {
        return $next($request)
            ->header('Access-Control-Allow-Origin', '*')
            ->header('Access-Control-Allow-Methods', 'POST, OPTIONS, PUT, PATCH, DELETE')
            ->header('Access-Control-Allow-Credentials', 'true')
            ->header('Access-Control-Max-Age', '10000')
            ->header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With');
    }
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);
    }
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);
    }
690363
public function handle($request, Closure $next)
    {
        if (Auth::check() && Auth::user()->hasRole("Admin")) {
        return $next($request);
        }
        return redirect('login');
        // return Redirect::back();

    }
611914
public function handle($request, Closure $next)
    {
        $paginationKey = config('pagination.key');

        $request->offsetSet($paginationKey, $request->paginationCount());

        return $next($request);
    }
1306936
public function handle($request, Closure $next)
    {
        if ($this->auth->parser()->setRequest($request)->hasToken()) {
            try {
                $this->auth->parseToken()->authenticate();
            } catch (Exception $e) {
                //
            }
        }

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

        return $next($request);
    }
662209
public function handle($request, Closure $next)
    {
        if (env('APP_ENV') !== 'testing') {
            header('Access-Control-Allow-Origin: *');
            header('Access-Control-Allow-Credentials: true');
            header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
            header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, token, _');
            header('Content-Type: application/json; charset=utf-8');
        }

        if ($request->getRealMethod() == 'OPTIONS') {
            return new \Illuminate\Http\Response('OK', 200);
        }

        return $next($request);
    }
801350
public function handle($request, Closure $next)
    {
        $this->attributes = array_slice(func_get_args(), 2);

        $this->clean($request);

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

        $this->authorizer->checkAuthCodeRequest();

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

        return $next($request);
    }