diff --git a/src/Router.php b/src/Router.php index 0bd10d0..d2dcc1b 100644 --- a/src/Router.php +++ b/src/Router.php @@ -824,7 +824,7 @@ private static function handle(?array $routes = null, bool $quitAfterRun = false // hacky solution to handle middleware catching all middleware with pattern (.*?) $routesToRun = array_filter($routeToHandle, function ($route) use ($uri) { - return $route['route']['pattern'] === $uri || $route['route']['pattern'] === '/.*'; + return $route['route']['pattern'] === $uri || $route['route']['pattern'] === '/.*' || implode('/', $route['params'] ?? []) === ltrim($uri, '/'); }); if (empty($routesToRun)) {