Gets a route by name defined in this collection or its children.
string $name The route name:
Route|null A Route instance or null when not found
public function get($name) {
if (isset($this->routes[$name])) {
return $this->routes[$name] instanceof RouteCollection ? null : $this->routes[$name];
}
foreach ($this->routes as $routes) {
if ($routes instanceof RouteCollection && null !== ($route = $routes
->get($name))) {
return $route;
}
}
return null;
}