public function __invoke(RouteCollector $router) { $routes = $this->collection->all(); foreach ($routes as $name => $route) { $router->addRoute($route->getMethods(), $route->getPath(), $name); } }
public function withRoutes(CollectionInterface $routes) { $this->routes = array_merge($this->routes, $routes->all()); }