src/Http/Middleware/BootJsonApi.php
public function handle($request, Closure $next, string $namespace)
    {
        /** Build and register the API. */
        $api = $this->bindApi($namespace, $request->getSchemeAndHttpHost() . $request->getBaseUrl());

        /** Substitute route bindings. */
        $this->substituteBindings($api);

        /** Set up the Laravel paginator to read from JSON API request instead */
        $this->bindPageResolver();

        return $next($request);
    }
public function handle($request, Closure $next, string $namespace)
    {
        /** Build and register the API. */
        $api = $this->bindApi($namespace, $request->getSchemeAndHttpHost() . $request->getBaseUrl());

        /** Substitute route bindings. */
        $this->substituteBindings($api);

        /** Set up the Laravel paginator to read from JSON API request instead */
        $this->bindPageResolver();

        return $next($request);
    }
public function handle ( $ request , Closure $ next , string $ namespace ) { /** Build and register the API. */ $ api = $ this -> bindApi ( $ namespace , $ request -> getSchemeAndHttpHost ( ) . $ request -> getBaseUrl ( ) ) ; /** Substitute route bindings. */ $ this -> substituteBindings ( $ api ) ; /** Set up the Laravel paginator to read from JSON API request instead */ $ this -> bindPageResolver ( ) ; return $ next ( $ request ) ; }
Start JSON API support.

This middleware:

- Loads the configuration for the named API that this request is being routed to.
- Registers the API in the service container.
- Substitutes bindings on the route.
- Overrides the Laravel current page resolver so that it uses the JSON API page parameter.

@param Request $request
@param Closure $next
@param string $namespace
the API namespace, as per your JSON API configuration.
@return mixed
Start JSON API support .