Skip to content

Commit

Permalink
Merge pull request #259 from mvenghaus/main
Browse files Browse the repository at this point in the history
fix when base path is app path
  • Loading branch information
rubenvanassche authored Mar 13, 2024
2 parents 178f196 + da2acab commit ba0068b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Console/MakeSettingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down

0 comments on commit ba0068b

Please sign in to comment.