interface RouteCollectionInterface implements Countable

Methods

add(Route $route)

Add a Route instance to the collection.

void
refreshNameLookups()

Refresh the name look-up table.

void
refreshActionLookups()

Refresh the action look-up table.

match(Request $request)

Find the first route matching a given request.

array
get(string|null $method = null)

Get routes from the collection by method.

bool
hasNamedRoute(string $name)

Determine if the route collection contains a given named route.

Route|null
getByName(string $name)

Get a route instance by its name.

Route|null
getByAction(string $action)

Get a route instance by its controller action.

array
getWarmableRoutes()

Get the route instances that should be pre-warmed.

array
getRoutes()

Get all of the routes in the collection.

array
getRoutesByMethod()

Get all of the routes keyed by their HTTP verb / method.

array
getRoutesByName()

Get all of the routes keyed by their name.

Details

at line 15
Route add(Route $route)

Add a Route instance to the collection.

Parameters

Route $route

Return Value

Route

at line 22
void refreshNameLookups()

Refresh the name look-up table.

This is done in case any names are fluently defined or if routes are overwritten.

Return Value

void

at line 29
void refreshActionLookups()

Refresh the action look-up table.

This is done in case any actions are overwritten with new controllers.

Return Value

void

at line 37
Route match(Request $request)

Find the first route matching a given request.

Parameters

Request $request

Return Value

Route

Exceptions

MethodNotAllowedHttpException
NotFoundHttpException

at line 44
array get(string|null $method = null)

Get routes from the collection by method.

Parameters

string|null $method

Return Value

array

at line 49
bool hasNamedRoute(string $name)

Determine if the route collection contains a given named route.

Parameters

string $name

Return Value

bool

at line 54
Route|null getByName(string $name)

Get a route instance by its name.

Parameters

string $name

Return Value

Route|null

at line 59
Route|null getByAction(string $action)

Get a route instance by its controller action.

Parameters

string $action

Return Value

Route|null

at line 66
array getWarmableRoutes()

Get the route instances that should be pre-warmed.

Return Value

array

at line 73
array getRoutes()

Get all of the routes in the collection.

Return Value

array

at line 80
array getRoutesByMethod()

Get all of the routes keyed by their HTTP verb / method.

Return Value

array

at line 87
array getRoutesByName()

Get all of the routes keyed by their name.

Return Value

array