class Illuminate / Routing / CompiledRouteCollection
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

CompiledRouteCollection

Extends

Properties

protected

$compiled array

The compiled routes collection.

Default: []
protected

$attributes array

An array of the route attributes keyed by name.

Default: []
protected

$routes RouteCollection |null

The dynamically added routes that were added after loading the cached, compiled routes.

Default: null
protected

$router Router

The router instance used by the route.

Default: null
protected

$container Container

The container instance used by the route.

Default: null

Methods

public

__construct ( array $compiled , array $attributes ) : void

Create a new CompiledRouteCollection instance.

Parameters

  • $compiled array
  • $attributes array
public

add ( Route $route ) : Route

Add a Route instance to the collection.

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

protected

requestWithoutTrailingSlash ( Request $request ) : Request

Get a cloned instance of the given request without any trailing slash on the URI.

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.

protected

newRoute ( array $attributes ) : Route

Resolve an array of attributes to a Route instance.

Parameters

  • $attributes array
public

setRouter ( Router $router ) : $this

Set the router instance on the route.

Parameters

public

setContainer ( Container $container ) : $this

Set the container instance on the route.

Parameters