On this page
RouteCollectionInterface
interface RouteCollectionInterface (View source)
Methods
Route | 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. |
|
Route | match(Request $request) Find the first route matching a given request. |
|
Route[] | 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. |
|
Route[] | getRoutes() Get all of the routes in the collection. |
|
array | getRoutesByMethod() Get all of the routes keyed by their HTTP verb / method. |
|
Route[] | getRoutesByName() Get all of the routes keyed by their name. |
Details
void refreshNameLookups()
Refresh the name look-up table.
This is done in case any names are fluently defined or if routes are overwritten.
void refreshActionLookups()
Refresh the action look-up table.
This is done in case any actions are overwritten with new controllers.
Route[] 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.
Route[] getRoutes()
Get all of the routes in the collection.
array getRoutesByMethod()
Get all of the routes keyed by their HTTP verb / method.
Route[] getRoutesByName()
Get all of the routes keyed by their name.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Routing/RouteCollectionInterface.html