setDescription('create a new resource'); $this->addOption('collection', 'c', InputOption::VALUE_NONE, 'Create a resource collection'); $this->addOption('grpc', null, InputOption::VALUE_NONE, 'Create a grpc resource'); } protected function getStub(): string { return $this->isGrpc() ? __DIR__ . '/stubs/resource-grpc.stub' : ($this->isCollection() ? __DIR__ . '/stubs/resource-collection.stub' : __DIR__ . '/stubs/resource.stub'); } protected function getDefaultNamespace(): string { return $this->getConfig()['namespace'] ?? 'App\\Resource'; } protected function isCollection(): bool { return $this->input->getOption('collection') || Str::endsWith($this->input->getArgument('name'), 'Collection'); } protected function isGrpc(): bool { return $this->input->getOption('grpc'); } }