diff --git a/config/config.php b/config/config.php index 333a1fb9a..e2d4d9dd1 100644 --- a/config/config.php +++ b/config/config.php @@ -39,12 +39,12 @@ 'package' => 'package.json', ], 'replacements' => [ - 'routes/web' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'], - 'routes/api' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'], - 'vite' => ['LOWER_NAME', 'STUDLY_NAME'], - 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'], + 'routes/web' => ['LOWER_NAME', 'STUDLY_NAME', 'KEBAB_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'], + 'routes/api' => ['LOWER_NAME', 'STUDLY_NAME', 'KEBAB_NAME', 'MODULE_NAMESPACE', 'CONTROLLER_NAMESPACE'], + 'vite' => ['LOWER_NAME', 'STUDLY_NAME', 'KEBAB_NAME'], + 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'KEBAB_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'], 'views/index' => ['LOWER_NAME'], - 'views/master' => ['LOWER_NAME', 'STUDLY_NAME'], + 'views/master' => ['LOWER_NAME', 'STUDLY_NAME', 'KEBAB_NAME',], 'scaffold/config' => ['STUDLY_NAME'], 'composer' => [ 'LOWER_NAME', diff --git a/src/Commands/Make/RouteProviderMakeCommand.php b/src/Commands/Make/RouteProviderMakeCommand.php index cd97e019f..1ed3b901f 100644 --- a/src/Commands/Make/RouteProviderMakeCommand.php +++ b/src/Commands/Make/RouteProviderMakeCommand.php @@ -65,6 +65,7 @@ protected function getTemplateContents() 'WEB_ROUTES_PATH' => $this->getWebRoutesPath(), 'API_ROUTES_PATH' => $this->getApiRoutesPath(), 'LOWER_NAME' => $module->getLowerName(), + 'KEBAB_NAME' => $module->getKebabName(), ]))->render(); } diff --git a/src/Generators/ModuleGenerator.php b/src/Generators/ModuleGenerator.php index ac8313200..cfe59adb2 100644 --- a/src/Generators/ModuleGenerator.php +++ b/src/Generators/ModuleGenerator.php @@ -547,6 +547,11 @@ protected function getLowerNameReplacement(): string return strtolower($this->getName()); } + protected function getKebabNameReplacement(): string + { + return Str::kebab($this->getName()); + } + /** * Get the module name in studly case. */ diff --git a/src/Module.php b/src/Module.php index 4ed08fb86..47e2ed9dc 100644 --- a/src/Module.php +++ b/src/Module.php @@ -125,6 +125,14 @@ public function getStudlyName(): string return Str::studly($this->name); } + /** + * Get name in studly case. + */ + public function getKebabName(): string + { + return Str::kebab($this->name); + } + /** * Get name in snake case. */