Exploración de los recursos existentes del modelo Rest.

@param  string  $model
@param  function  $closure
@param  \Fundamentary\Http\Request  $request
435222
public static function explorer($model, $closure = null, $request) {  
        $data = $request->getInteractionsRequest();

        if(file_exists(Dir::model($model))) {
            require_once(Dir::model($model));

            if($closure)
                $data = call_user_func_array(
                    $closure,
                    array('request' => $data)
                );

            if($data === $request->getInteractionsRequest())
                if(file_exists(Dir::controller($model))) {
                    require_once(Dir::controller($model));
                    self::make($model, $request, false);
                } else
                    self::make($model, $request, true);

        } else 
            killer('401');
    }
77037
public function handle($request, Closure $next)
    {
        if (! $request->ajax() && config('cortex.foundation.route.trailing_slash')) {
            $requestUri = $request->getRequestUri();
            $queryString = $request->getQueryString();
            $untrimmedPath = trim($request->getPathInfo(), '/').'/';

            if ($request->method() === 'GET' && mb_strrchr($requestUri, '.') === false && $this->checkQueryString($requestUri, $queryString)) {
                return redirect()->to($untrimmedPath.(! empty($queryString) ? '?'.$queryString : ''), 301);
            }
        }

        return $next($request);
    }
697842
public function handle(Request $request, Closure $next)
    {
        $cors = $this->getCorsAnalysis($request);

        switch ($cors->getRequestType()) {
            case AnalysisResultInterface::TYPE_REQUEST_OUT_OF_CORS_SCOPE:
                $response = $next($request);
                break;

            case AnalysisResultInterface::TYPE_PRE_FLIGHT_REQUEST:
                $headers  = $this->getPrepareCorsHeaders($cors->getResponseHeaders());
                $response = new Response(null, Response::HTTP_OK, $headers);
                break;

            case AnalysisResultInterface::TYPE_ACTUAL_REQUEST:
                /** @var Response $response */
                $response = $next($request);
                // merge CORS headers to response
                foreach ($this->getPrepareCorsHeaders($cors->getResponseHeaders()) as $name => $value) {
                    $response->headers->set($name, $value, false);
                }
                break;

            default:
                $response = $this->getResponseOnError($cors);
                break;
        }

        return $response;
    }
571766
protected function load($model, $request)
    {
        $model->load($request->getQueryParams());

        return $model->load($request->getBodyParams());
    }
1133529
public function handle($request, Closure $next, $model)
    {
        $model = 'App\\' . $model;
        $params = array_values( $request->route()->parameters() );
        // eğer ikinci yoksa dön
        if ( ! isset($params[1])) {
            return $next($request);
        }

        $parent_model = is_numeric($params[0]) ? $model::findOrFail($params[0]) : $params[0];
        $nested_model = is_numeric($params[1]) ? $model::findOrFail($params[1]) : $params[1];

        if ( ! $nested_model->isDescendantOf($parent_model)) {
            abort(404);
        }

        return $next($request);
    }
1119153
public function handle(Request $request, Closure $next)
    {
        $request = $this->processRequest($request);
        return $next($request);
    }
891680
public function handle($request, Closure $next)
    {
        if ( ! $this->repository->isLocalized()) {
            return $next($request);
        }

        $locale = $this->getValidSessionLocale();

        if ( ! $locale && $this->core->config('locale.request-based')) {
            $locale = $this->getRequestLocale($request);
        }

        if ($locale) {
            app()->setLocale($locale);
        }

        return $next($request);
    }
550569
public function handle($request, Closure $next)
    {
        session()->forget('active_menu');

        if (! $request->is(admin_prefix() . '*')) {
            $this->repository = app('navigation');
            $this->repository->getPublished()->each(function (Navigation $navigation) {
                MenuFactory::make($navigation->type, function (Builder $builder) use ($navigation) {
                    $navigation->menus->each(function (Menu $menu) use ($builder, &$assignment) {
                        $this->generateMenu($builder, $menu);
                    });
                });
            });
        }

        return $next($request);
    }
1138221
public function handle(Request $request, Closure $next)
    {
        if (!empty($paths = $this->guardedPaths($request))) {
            $request->merge(
                array_map([$this, 'sanitizePath'], $paths)
            );
        }

        return $next($request);
    }
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);
    }
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);
    }
729059
public function handle($request, Closure $next)
    {
        $acceptLanguage = $request->header('Accept-Language');
        $locale = $this->getLocale($acceptLanguage);
        \App::setLocale($locale);
        return $next($request);
    }
578527
public function handle($request, Closure $next)
    {
        if (!Session::has('language_setup')) {
            $languages = $this->languageRepository->all();
            $defaultLanguage = $this->languageRepository->getDefault();
            Session::put('languages', $languages);
            Session::put('default_language', $defaultLanguage);
            
            if ($languages->count() > 1) {
                Session::put('multi_language_enabled', true);   
            } else {
                Session::put('multi_language_enabled', false);
            }
            Session::put('language_setup', true);
        }
        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;
    }
776169
public function handle($request, Closure $next)
    {
        $route = $request->route();

        $this->router->substituteBindings($route);

        $this->substituteImplicitBindings($route);

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

        return $next($request);
    }
1302374
public function handle($request, Closure $next)
    {
        $reauth = new ReauthLimiter($request);

        if (!$reauth->check()) {
            $request->session()->put('url.intended', $request->url());

            return $this->invalidated($request);
        }

        return $next($request);
    }