diff --git a/src/Phaseolies/Support/Router.php b/src/Phaseolies/Support/Router.php index 26d1f3a..587fa09 100644 --- a/src/Phaseolies/Support/Router.php +++ b/src/Phaseolies/Support/Router.php @@ -787,7 +787,9 @@ public function getCallback($request): mixed if (preg_match($routeRegex, $url, $matches)) { $params = $this->extractRouteParameters($route, $matches); if ($params !== false) { - $request->setRouteParams($params); + $existing = $request->getRouteParams(); + $merged = array_merge($existing, $params); + $request->setRouteParams($merged); return $callback; } } @@ -830,6 +832,8 @@ protected function matchesDomain(string $domain, $request): bool $existing = $request->getRouteParams(); $existing[$m[1]] = $hostMatch[1]; $request->setRouteParams($existing); + $request->merge([$m[1] => $hostMatch[1]]); + return true; }