class RouteCollection implements Countable, IteratorAggregate (View source)

Methods

add( Route $route)

Add a Route instance to the collection.

void
refreshNameLookups()

Refresh the name look-up table.

match( Request $request)

Find the first route matching a given request.

array
get( string|null $method = null)

Get all of the routes in the collection.

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
getRoutes()

Get all of the routes in the collection.

array
getRoutesByMethod()

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

getIterator()

Get an iterator for the items.

int
count()

Count the number of items in the collection.

Details

at line line 50
Route add( Route $route)

Add a Route instance to the collection.

Parameters

Route $route

Return Value

Route

at line line 108
void refreshNameLookups()

Refresh the name look-up table.

This is done in case any names are fluently defined.

Return Value

void

at line line 139
Route match( Request $request)

Find the first route matching a given request.

Parameters

Request $request

Return Value

Route

Exceptions

NotFoundHttpException

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

Get all of the routes in the collection.

Parameters

string|null $method

Return Value

array

at line line 258
bool hasNamedRoute( string $name)

Determine if the route collection contains a given named route.

Parameters

string $name

Return Value

bool

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

Get a route instance by its name.

Parameters

string $name

Return Value

Route|null

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

Get a route instance by its controller action.

Parameters

string $action

Return Value

Route|null

at line line 290
array getRoutes()

Get all of the routes in the collection.

Return Value

array

at line line 300
array getRoutesByMethod()

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

Return Value

array

at line line 310
ArrayIterator getIterator()

Get an iterator for the items.

Return Value

ArrayIterator

at line line 320
int count()

Count the number of items in the collection.

Return Value

int