Skip to content

Commit fa691e6

Browse files
committed
Merge pull request laravel#78 from shnhrrsn/prefixed_routes_fix
Fixed ordering of Application->addRoute as it wasn’t accounting for group prefixes
2 parents bc8ec9f + e06e219 commit fa691e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -903,10 +903,6 @@ protected function addRoute($method, $uri, $action)
903903

904904
$uri = $uri === '/' ? $uri : '/'.trim($uri, '/');
905905

906-
if (isset($action['as'])) {
907-
$this->namedRoutes[$action['as']] = $uri;
908-
}
909-
910906
if (isset($this->groupAttributes)) {
911907
if (isset($this->groupAttributes['prefix'])) {
912908
$uri = rtrim('/'.trim($this->groupAttributes['prefix'], '/').$uri, '/');
@@ -915,6 +911,10 @@ protected function addRoute($method, $uri, $action)
915911
$action = $this->mergeGroupAttributes($action);
916912
}
917913

914+
if (isset($action['as'])) {
915+
$this->namedRoutes[$action['as']] = $uri;
916+
}
917+
918918
$this->routes[$method.$uri] = ['method' => $method, 'uri' => $uri, 'action' => $action];
919919
}
920920

0 commit comments

Comments
 (0)