class Illuminate / Routing / RouteCollection
You are viewing an older version of the documentation. For the latest, please visit master documentation.

RouteCollection

Extends

Properties

protected

$routes array

An array of the routes keyed by method.

Default: []
protected

$allRoutes Illuminate\...\Route[]

A flattened array of all of the routes.

Default: []
protected

$nameList Illuminate\...\Route[]

A look-up table of routes by their names.

Default: []
protected

$actionList Illuminate\...\Route[]

A look-up table of routes by controller action.

Default: []

Methods

public

add ( Route $route ) : Route

Add a Route instance to the collection.

Parameters

protected

addToCollections ( $route ) : void

Add the given route to the arrays of routes.

Parameters

protected

addLookups ( $route ) : void

Add the route to any look-up tables if necessary.

Parameters

protected

addToActionList ( $action , $route ) : void

Add a route to the controller action dictionary.

Parameters

public

refreshNameLookups ( ) : void

Refresh the name look-up table.

public

refreshActionLookups ( ) : void

Refresh the action look-up table.

public

match ( Request $request ) : Route

Find the first route matching a given request.

Parameters

public

get ( $method ) : Illuminate\...\Route[]

Get routes from the collection by method.

Parameters

  • $method string|null
public

hasNamedRoute ( $name ) : bool

Determine if the route collection contains a given named route.

Parameters

  • $name string
public

getByName ( $name ) : Route |null

Get a route instance by its name.

Parameters

  • $name string
public

getByAction ( $action ) : Route |null

Get a route instance by its controller action.

Parameters

  • $action string
public

getRoutes ( ) : Illuminate\...\Route[]

Get all of the routes in the collection.

public

getRoutesByMethod ( ) : array

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

public

getRoutesByName ( ) : Illuminate\...\Route[]

Get all of the routes keyed by their name.

public

toSymfonyRouteCollection ( ) : Symfony\...\RouteCollection

Convert the collection to a Symfony RouteCollection instance.

public

toCompiledRouteCollection ( Router $router , Container $container ) : CompiledRouteCollection

Convert the collection to a CompiledRouteCollection instance.

Parameters