diff --git a/src/Console/MakeSettingCommand.php b/src/Console/MakeSettingCommand.php index 2358040..549a4ca 100644 --- a/src/Console/MakeSettingCommand.php +++ b/src/Console/MakeSettingCommand.php @@ -110,7 +110,17 @@ protected function getPath($name, $path): string protected function getNamespace($path): string { - $path = trim(str_replace([base_path(), '/'], ['', '\\'], $path), '\\'); + $path = preg_replace( + [ + '/^(' . preg_quote(base_path(), '/') . ')/', + '/\//' + ], + [ + '', + '\\' + ], + $path + ); return implode('\\', array_map(fn ($directory) => ucfirst($directory), explode('\\', $path))); }