Skip to content

Commit

Permalink
Normalize paths at the DomainGeneratorCommand level
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Mar 11, 2024
1 parent 09e44c0 commit 75d1783
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Commands/DomainGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ protected function getDomainBasePath()

protected function getPath($name)
{
$name = str($name)
$normalizedPath = str($name)
->replaceFirst($this->rootNamespace(), '')
->replace('\\', '/')
->ltrim('/')
->append('.php')
->prepend($this->getDomainBasePath() . DIRECTORY_SEPARATOR)
->replace(['/', '\\'], DIRECTORY_SEPARATOR)
->toString();

return $this->getDomainBasePath().'/'.$name;
return $normalizedPath;
}

protected function resolveStubPath($path)
Expand Down

0 comments on commit 75d1783

Please sign in to comment.