Gets the number of Routes in this collection.
int The number of routes in this collection, including nested collections
public function count() {
$count = 0;
foreach ($this->routes as $route) {
$count += $route instanceof RouteCollection ? count($route) : 1;
}
return $count;
}