Skip to content

Commit 1fc9082

Browse files
FP1-95: Adding id to the route parameters
1 parent fb80242 commit 1fc9082

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/RouteInformation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function createFromRoute(Route $route): RouteInformation
6666

6767
if (count($parameters) > 0) {
6868
$parameters = $parameters->map(static fn ($parameter) => [
69-
'name' => Str::replaceLast('?', '', $parameter),
69+
'name' => Str::replaceLast('?', '', $parameter . ":id"),
7070
'required' => ! Str::endsWith($parameter, '?'),
7171
]);
7272
}
@@ -85,7 +85,7 @@ public static function createFromRoute(Route $route): RouteInformation
8585

8686
$instance->domain = $route->domain();
8787
$instance->method = $method;
88-
$instance->uri = Str::start($route->uri(), '/');
88+
$instance->uri = Str::start(preg_replace('/{(.*?)}/', '{${1}:id}', $route->uri), '/');
8989
$instance->name = $route->getName();
9090
$instance->controller = $controller;
9191
$instance->parameters = $parameters;

0 commit comments

Comments
 (0)