diff --git a/src/Laravel/Middleware/Cors.php b/src/Laravel/Middleware/Cors.php index 04e1bca..45b91aa 100644 --- a/src/Laravel/Middleware/Cors.php +++ b/src/Laravel/Middleware/Cors.php @@ -96,7 +96,7 @@ protected function hasShouldRouteGroup($request): bool $shouldClsssName = ShouldGroup::class; $shouldAlias = collect(Route::getMiddleware())->flip()->get($shouldClsssName, $shouldClsssName); $gatherMiddleware = collect(Route::getRoutes()->get())->first(function ($route) use ($request) { - return $route->uri() === $request->path(); + return $route->matches($request, false); })->gatherMiddleware(); if (in_array($shouldClsssName, $gatherMiddleware) || in_array($shouldAlias, $gatherMiddleware)) {