diff --git a/src/Commands/ControllerMakeCommand.php b/src/Commands/ControllerMakeCommand.php index dd02f84..7780a3a 100644 --- a/src/Commands/ControllerMakeCommand.php +++ b/src/Commands/ControllerMakeCommand.php @@ -109,14 +109,16 @@ protected function generateFormRequests($modelClass, $storeRequestClass, $update { $storeRequestClass = 'Store'.class_basename($modelClass).'Request'; - $this->call('make:request', [ + $this->call('modular:make-request', [ 'name' => $storeRequestClass, + 'module' => $this->getModule()->name(), ]); $updateRequestClass = 'Update'.class_basename($modelClass).'Request'; - $this->call('make:request', [ + $this->call('modular:make-request', [ 'name' => $updateRequestClass, + 'module' => $this->getModule()->name(), ]); return [$storeRequestClass, $updateRequestClass]; diff --git a/src/Commands/ModelMakeCommand.php b/src/Commands/ModelMakeCommand.php index 6a3c6cf..fe4d97d 100644 --- a/src/Commands/ModelMakeCommand.php +++ b/src/Commands/ModelMakeCommand.php @@ -85,8 +85,9 @@ protected function createPolicy(): void { $policy = Str::studly(class_basename($this->argument('name'))); - $this->call('make:policy', [ + $this->call('modular:make-policy', [ 'name' => "{$policy}Policy", + 'module' => $this->getModule()->name(), '--model' => $this->qualifyClass($this->getNameInput()), ]); } diff --git a/src/Commands/RequestMakeCommand.php b/src/Commands/RequestMakeCommand.php new file mode 100644 index 0000000..523c992 --- /dev/null +++ b/src/Commands/RequestMakeCommand.php @@ -0,0 +1,19 @@ +hasConfigFile('modular') ->hasViews(static::$viewNamespace) ->hasCommands($this->getCommands()) + ->hasMigrations($this->getMigrationFiles()) ->hasInstallCommand(function (InstallCommand $command) { // get repo name from composer.json $name = json_decode(file_get_contents(base_path('composer.json')))?->name;