@@ -1353,10 +1353,11 @@ protected function create(string $verb, string $from, $to, ?array $options = nul
1353
1353
}
1354
1354
}
1355
1355
1356
+ $ routeKey = $ from ;
1356
1357
// Replace our regex pattern placeholders with the actual thing
1357
1358
// so that the Router doesn't need to know about any of this.
1358
1359
foreach ($ this ->placeholders as $ tag => $ pattern ) {
1359
- $ from = str_ireplace (': ' . $ tag , $ pattern , $ from );
1360
+ $ routeKey = str_ireplace (': ' . $ tag , $ pattern , $ routeKey );
1360
1361
}
1361
1362
1362
1363
// If is redirect, No processing
@@ -1371,7 +1372,7 @@ protected function create(string $verb, string $from, $to, ?array $options = nul
1371
1372
$ to = '\\' . ltrim ($ to , '\\' );
1372
1373
}
1373
1374
1374
- $ name = $ options ['as ' ] ?? $ from ;
1375
+ $ name = $ options ['as ' ] ?? $ routeKey ;
1375
1376
1376
1377
helper ('array ' );
1377
1378
@@ -1380,16 +1381,16 @@ protected function create(string $verb, string $from, $to, ?array $options = nul
1380
1381
// routes should always be the "source of truth".
1381
1382
// this works only because discovered routes are added just prior
1382
1383
// to attempting to route the request.
1383
- $ fromExists = dot_array_search ('*.route. ' . $ from , $ this ->routes [$ verb ] ?? []) !== null ;
1384
+ $ fromExists = dot_array_search ('*.route. ' . $ routeKey , $ this ->routes [$ verb ] ?? []) !== null ;
1384
1385
if ((isset ($ this ->routes [$ verb ][$ name ]) || $ fromExists ) && ! $ overwrite ) {
1385
1386
return ;
1386
1387
}
1387
1388
1388
1389
$ this ->routes [$ verb ][$ name ] = [
1389
- 'route ' => [$ from => $ to ],
1390
+ 'route ' => [$ routeKey => $ to ],
1390
1391
];
1391
1392
1392
- $ this ->routesOptions [$ verb ][$ from ] = $ options ;
1393
+ $ this ->routesOptions [$ verb ][$ routeKey ] = $ options ;
1393
1394
1394
1395
// Is this a redirect?
1395
1396
if (isset ($ options ['redirect ' ]) && is_numeric ($ options ['redirect ' ])) {
0 commit comments