Skip to content

Commit 8a12806

Browse files
authored
Update RouteGroup.php
1 parent a4c350e commit 8a12806

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/RouteGroup.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,17 @@ public function addRoute(RouteRecord $route): self
6060

6161
return $this;
6262
}
63+
64+
/**
65+
* @internal
66+
*/
67+
public static function copy(RouteMap $newMap, RouteGroup $group): self
68+
{
69+
$copy = new self($group->name, $group->prefix, $newMap);
70+
foreach ($group->routes as $k => $route) {
71+
$copy->routes[$k] = clone $route;
72+
}
73+
74+
return $copy;
75+
}
6376
}

0 commit comments

Comments
 (0)