diff --git a/src/http-server/src/Router/DispatcherFactory.php b/src/http-server/src/Router/DispatcherFactory.php index 849382c00..5b155f046 100644 --- a/src/http-server/src/Router/DispatcherFactory.php +++ b/src/http-server/src/Router/DispatcherFactory.php @@ -200,8 +200,9 @@ class DispatcherFactory { if (! $prefix) { $handledNamespace = Str::replaceFirst('Controller', '', Str::after($className, '\\Controller\\')); - $handledNamespace = Str::replaceArray('\\', ['/'], $handledNamespace); + $handledNamespace = str_replace('\\', '/', $handledNamespace); $prefix = Str::snake($handledNamespace); + $prefix = str_replace('/_', '/', $prefix); } if ($prefix[0] !== '/') { $prefix = '/' . $prefix;