diff --git a/src/Commands/MakeModelCommand.php b/src/Commands/MakeModelCommand.php index 0abb768..c95a93c 100644 --- a/src/Commands/MakeModelCommand.php +++ b/src/Commands/MakeModelCommand.php @@ -24,6 +24,7 @@ protected function configure() $this->addArgument('name', InputArgument::REQUIRED, 'Model name'); $this->addArgument('type', InputArgument::OPTIONAL, 'Type'); $this->addOption('connection', 'c', InputOption::VALUE_OPTIONAL, 'Select database connection. '); + $this->addOption('yes', 'y', InputOption::VALUE_NONE, 'Skip confirmation'); } /** @@ -75,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $type = !$database && $thinkorm ? 'tp' : 'laravel'; } - if (is_file($file)) { + if (is_file($file) && !$input->getOption('yes')) { $helper = $this->getHelper('question'); $question = new ConfirmationQuestion("$file already exists. Do you want to override it? (yes/no)", false); if (!$helper->ask($input, $output, $question)) {