Skip to content

Commit

Permalink
Merge pull request #262 from hamzaelmaghari/patch-2
Browse files Browse the repository at this point in the history
Update MakeSettingCommand.php
  • Loading branch information
rubenvanassche authored Mar 22, 2024
2 parents 2c4500e + f50078c commit 3950667
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Console/MakeSettingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ protected function getNamespace($path): string
$path
);

return implode('\\', array_map(fn ($directory) => ucfirst($directory), explode('\\', $path)));
$namespace = implode('\\', array_map(fn ($directory) => ucfirst($directory), explode('\\', $path)));

// Remove leading backslash if present
if (substr($namespace, 0, 1) === '\\') {
$namespace = substr($namespace, 1);
}

return $namespace;
}
}

0 comments on commit 3950667

Please sign in to comment.