PHP Class Dingo\Api\Routing\Adapter\Laravel

Inheritance: implements Dingo\Api\Contract\Routing\Adapter
Datei anzeigen Open project: dingo/api

Protected Properties

Property Type Description
$container Illuminate\Contracts\Container\Container Application container instance.
$mergedRoutes array Array of merged old routes and API routes.
$oldRoutes Illuminate\Routing\RouteCollection Routes already defined on the router.
$router Illuminate\Routing\Router Laravel router instance.
$routes array Array of registered routes.

Public Methods

Method Description
__construct ( Router $router ) : void Create a new laravel routing adapter instance.
addRoute ( array $methods, array $versions, string $uri, mixed $action ) : Illuminate\Routing\Route Add a route to the appropriate route collection.
dispatch ( Illuminate\Http\Request $request, string $version ) : mixed Dispatch a request.
gatherRouteMiddlewares ( Illuminate\Routing\Route $route ) : array Gather the route middlewares.
getIterableRoutes ( string $version = null ) : mixed Get a normalized iterable set of routes.
getRouteProperties ( mixed $route, Illuminate\Http\Request $request ) : array Get the URI, methods, and action from the route.
getRouter ( ) : Router Get the Laravel router instance.
getRoutes ( string $version = null ) : mixed Get all routes or only for a specific version.
prepareRouteForSerialization ( mixed $route ) : mixed Prepare a route for serialization.
setRoutes ( array $routes ) : void Set the routes on the adapter.

Protected Methods

Method Description
createRouteCollections ( array $versions ) : void Create the route collections for the versions.
mergeOldRoutes ( string $version ) : array Merge the old application routes with the API routes.

Method Details

__construct() public method

Create a new laravel routing adapter instance.
public __construct ( Router $router ) : void
$router Illuminate\Routing\Router
return void

addRoute() public method

Add a route to the appropriate route collection.
public addRoute ( array $methods, array $versions, string $uri, mixed $action ) : Illuminate\Routing\Route
$methods array
$versions array
$uri string
$action mixed
return Illuminate\Routing\Route

createRouteCollections() protected method

Create the route collections for the versions.
protected createRouteCollections ( array $versions ) : void
$versions array
return void

dispatch() public method

Dispatch a request.
public dispatch ( Illuminate\Http\Request $request, string $version ) : mixed
$request Illuminate\Http\Request
$version string
return mixed

gatherRouteMiddlewares() public method

Gather the route middlewares.
public gatherRouteMiddlewares ( Illuminate\Routing\Route $route ) : array
$route Illuminate\Routing\Route
return array

getIterableRoutes() public method

Get a normalized iterable set of routes.
public getIterableRoutes ( string $version = null ) : mixed
$version string
return mixed

getRouteProperties() public method

Get the URI, methods, and action from the route.
public getRouteProperties ( mixed $route, Illuminate\Http\Request $request ) : array
$route mixed
$request Illuminate\Http\Request
return array

getRouter() public method

Get the Laravel router instance.
public getRouter ( ) : Router
return Illuminate\Routing\Router

getRoutes() public method

Get all routes or only for a specific version.
public getRoutes ( string $version = null ) : mixed
$version string
return mixed

mergeOldRoutes() protected method

Merge the old application routes with the API routes.
protected mergeOldRoutes ( string $version ) : array
$version string
return array

prepareRouteForSerialization() public method

Prepare a route for serialization.
public prepareRouteForSerialization ( mixed $route ) : mixed
$route mixed
return mixed

setRoutes() public method

Set the routes on the adapter.
public setRoutes ( array $routes ) : void
$routes array
return void

Property Details

$container protected_oe property

Application container instance.
protected Container,Illuminate\Contracts\Container $container
return Illuminate\Contracts\Container\Container

$mergedRoutes protected_oe property

Array of merged old routes and API routes.
protected array $mergedRoutes
return array

$oldRoutes protected_oe property

Routes already defined on the router.
protected RouteCollection,Illuminate\Routing $oldRoutes
return Illuminate\Routing\RouteCollection

$router protected_oe property

Laravel router instance.
protected Router,Illuminate\Routing $router
return Illuminate\Routing\Router

$routes protected_oe property

Array of registered routes.
protected array $routes
return array