RouteCollection
class RouteCollection implements Countable, IteratorAggregate (View source)
Properties
protected array | $routes | An array of the routes keyed by method. | |
protected array | $allRoutes | An flattened array of all of the routes. | |
protected array | $nameList | A look-up table of routes by their names. | |
protected array | $actionList | A look-up table of routes by controller action. |
Methods
Route | add(Route $route) Add a Route instance to the collection. | |
void | addToCollections(Route $route) Add the given route to the arrays of routes. | |
void | addLookups(Route $route) Add the route to any look-up tables if necessary. | |
void | addToActionList(array $action, Route $route) Add a route to the controller action dictionary. | |
Route | match(Request $request) Find the first route matching a given request. | |
array | checkForAlternateVerbs(Request $request) Determine if any routes match on another HTTP verb. | |
Route | getOtherMethodsRoute(Request $request, array $others) Get a route (if necessary) that responds when other available methods are present. | |
void | methodNotAllowed(array $others) Throw a method not allowed HTTP exception. | |
Route|null | check(array $routes, Request $request, bool $includingMethod = true) Determine if a route in the array matches the 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. | |
ArrayIterator | getIterator() Get an iterator for the items. | |
int | count() Count the number of items in the collection. |
Details
protected void addToCollections(Route $route)
Add the given route to the arrays of routes.
protected void addLookups(Route $route)
Add the route to any look-up tables if necessary.
protected void addToActionList(array $action, Route $route)
Add a route to the controller action dictionary.
protected array checkForAlternateVerbs(Request $request)
Determine if any routes match on another HTTP verb.
protected Route getOtherMethodsRoute(Request $request, array $others)
Get a route (if necessary) that responds when other available methods are present.
protected void methodNotAllowed(array $others)
Throw a method not allowed HTTP exception.
protected Route|null check(array $routes, Request $request, bool $includingMethod = true)
Determine if a route in the array matches the request.
protected 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.
ArrayIterator getIterator()
Get an iterator for the items.
int count()
Count the number of items in the collection.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Routing/RouteCollection.html