Skip to content

Commit

Permalink
Add the ability to get routes keyed by method
Browse files Browse the repository at this point in the history
  • Loading branch information
David Gvritishvili committed Apr 13, 2016
1 parent 30f3ce7 commit cd21d82
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Illuminate/Routing/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected function check(array $routes, $request, $includingMethod = true)
* @param string|null $method
* @return array
*/
protected function get($method = null)
public function get($method = null)
{
if (is_null($method)) {
return $this->getRoutes();
Expand Down Expand Up @@ -292,6 +292,16 @@ public function getRoutes()
return array_values($this->allRoutes);
}

/**
* Get all of the routes keyed by method in the collection.
*
* @return array
*/
public function getKeyedRoutes()
{
return $this->routes;
}

/**
* Get an iterator for the items.
*
Expand Down

0 comments on commit cd21d82

Please sign in to comment.