diff --git a/src/Commands/MakeFactory.php b/src/Commands/MakeFactory.php index 0fc7085..b18b702 100644 --- a/src/Commands/MakeFactory.php +++ b/src/Commands/MakeFactory.php @@ -3,6 +3,7 @@ namespace Lunarstorm\LaravelDDD\Commands; use Lunarstorm\LaravelDDD\Support\Domain; +use Lunarstorm\LaravelDDD\Support\Path; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; @@ -74,7 +75,7 @@ protected function getPath($name) ->append('.php') ->toString(); - return base_path('database/factories/'.$name); + return Path::normalize(base_path('database/factories/'.$name)); } protected function getFactoryName() diff --git a/tests/Generator/MakeFactoryTest.php b/tests/Generator/MakeFactoryTest.php index 1f3f82e..16ad901 100644 --- a/tests/Generator/MakeFactoryTest.php +++ b/tests/Generator/MakeFactoryTest.php @@ -4,6 +4,7 @@ use Illuminate\Support\Facades\Config; use Illuminate\Support\Str; use Lunarstorm\LaravelDDD\Support\Domain; +use Lunarstorm\LaravelDDD\Support\Path; use Lunarstorm\LaravelDDD\Tests\Fixtures\Enums\Feature; it('can generate domain factories', function ($domainPath, $domainRoot, $domain, $subdomain) { @@ -23,7 +24,7 @@ $domainFactory = $domain->factory($factoryName); - $expectedFactoryPath = base_path($domainFactory->path); + $expectedFactoryPath = Path::normalize(base_path($domainFactory->path)); if (file_exists($expectedFactoryPath)) { unlink($expectedFactoryPath);