Skip to content

Commit

Permalink
fix a bug where route names could have 2 consecutive dots
Browse files Browse the repository at this point in the history
  • Loading branch information
IngeniozIT committed May 10, 2024
1 parent 287855a commit 9917fd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/RouteGroup.php
Expand Up @@ -61,6 +61,6 @@ private function concatenatedNameForRouteElement(?string $routeName): ?string

private function concatenatedNameForRouteGroup(): ?string
{
return $this->name === null ? null : $this->name . '.';
return $this->name === null ? null : str_replace('..', '.', $this->name . '.');
}
}
6 changes: 5 additions & 1 deletion tests/NameTest.php
Expand Up @@ -55,7 +55,11 @@ public function testRouteGroupsPassTheirNameToTheirSubRoutes(): void
{
$routeGroup = new RouteGroup(
[
Route::get('/foo', 'foo', name: 'route_name'),
new RouteGroup(
[
Route::get('/foo', 'foo', name: 'route_name'),
],
),
],
name: 'group',
);
Expand Down

0 comments on commit 9917fd0

Please sign in to comment.