Skip to content

Commit 13b013b

Browse files
author
Arif Hoque
committed
route parameter issue resolved for tenant based routing:
1 parent c216c73 commit 13b013b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Phaseolies/Support/Router.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,9 @@ public function getCallback($request): mixed
787787
if (preg_match($routeRegex, $url, $matches)) {
788788
$params = $this->extractRouteParameters($route, $matches);
789789
if ($params !== false) {
790-
$request->setRouteParams($params);
790+
$existing = $request->getRouteParams();
791+
$merged = array_merge($existing, $params);
792+
$request->setRouteParams($merged);
791793
return $callback;
792794
}
793795
}
@@ -830,6 +832,8 @@ protected function matchesDomain(string $domain, $request): bool
830832
$existing = $request->getRouteParams();
831833
$existing[$m[1]] = $hostMatch[1];
832834
$request->setRouteParams($existing);
835+
$request->merge([$m[1] => $hostMatch[1]]);
836+
833837
return true;
834838
}
835839

0 commit comments

Comments
 (0)