diff --git a/src/Generators/FactoryGenerator.php b/src/Generators/FactoryGenerator.php index 9e379515..55840960 100644 --- a/src/Generators/FactoryGenerator.php +++ b/src/Generators/FactoryGenerator.php @@ -83,6 +83,7 @@ protected function populateStub(string $stub, Model $model) $stub = str_replace('definition()', 'definition(): array', $stub); } + $stub = str_replace('{{ namespace }}', 'Database\Factories' . ($model->namespace() ? '\\' . $model->namespace() : ''), $stub); $stub = str_replace('use {{ namespacedModel }};', $this->buildImports($model), $stub); return $stub; diff --git a/stubs/factory.stub b/stubs/factory.stub index bc895ed2..e3e1073a 100644 --- a/stubs/factory.stub +++ b/stubs/factory.stub @@ -1,6 +1,6 @@