option('handler')) { $this->call('handler:command', [ 'name' => $this->argument('name').'Handler', '--command' => $this->parseName($this->argument('name')), ]); } } /** * Get the stub file for the generator. * * @return string */ protected function getStub() { if ($this->option('queued') && $this->option('handler')) { return __DIR__.'/stubs/command-queued-with-handler.stub'; } elseif ($this->option('queued')) { return __DIR__.'/stubs/command-queued.stub'; } elseif ($this->option('handler')) { return __DIR__.'/stubs/command-with-handler.stub'; } else { return __DIR__.'/stubs/command.stub'; } } /** * Get the default namespace for the class. * * @param string $rootNamespace * @return string */ protected function getDefaultNamespace($rootNamespace) { return $rootNamespace.'\Commands'; } /** * Get the console command options. * * @return array */ protected function getOptions() { return [ ['handler', null, InputOption::VALUE_NONE, 'Indicates that handler class should be generated.'], ['queued', null, InputOption::VALUE_NONE, 'Indicates that command should be queued.'], ]; } }