diff --git a/config/artisan-maker.php b/config/artisan-maker.php index c618917..7f5c6ca 100644 --- a/config/artisan-maker.php +++ b/config/artisan-maker.php @@ -3,19 +3,31 @@ return [ /** * Set your default namespace for Service class. - * This will also affect the directory of your service class location. */ 'service_namespace' => 'App\Services', + /** + * Set the default directory for your service class location. + */ + 'service_directory' => 'app/Services', + /** * Set your default namespace for Action class - * This will also affect the directory of your action class location. */ 'action_namespace' => 'App\Actions', + /** + * Set the default directory for your action class location. + */ + 'action_directory' => 'app/Actions', + /** * Set your default namespace for Interface class - * This will also affect the directory of your interface class location. */ 'interface_namespace' => 'App\Contracts', + + /** + * Set the default directory for your interface class location. + */ + 'interface_directory' => 'app/Contracts', ]; \ No newline at end of file diff --git a/src/Console/FileGenerable.php b/src/Console/FileGenerable.php index 255dbcf..b22beed 100644 --- a/src/Console/FileGenerable.php +++ b/src/Console/FileGenerable.php @@ -37,4 +37,10 @@ protected function getDefaultNamespace($rootNamespace): string return $nameSpace; } + + protected function getPath($name) + { + $type = Str::lower($this->type); + return $this->laravel->basePath() . '/' . config("artisan-maker.{$type}_directory") . '/' . $this->getNameInput() .'.php'; + } } \ No newline at end of file diff --git a/src/Console/ServiceMakeCommand.php b/src/Console/ServiceMakeCommand.php index f357f8b..e371c8e 100644 --- a/src/Console/ServiceMakeCommand.php +++ b/src/Console/ServiceMakeCommand.php @@ -34,7 +34,6 @@ protected function buildClass($name): string } } - $stub = $this->files->get($this->getClassImplementInterfaceStub()); return $this