diff --git a/src/NewCommand.php b/src/NewCommand.php index b6f766f..30bd1ab 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -241,7 +241,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(''); } - $this->configureComposerScript($directory); + $this->configureComposerDevScript($directory); $output->writeln(" <bg=blue;fg=white> INFO </> Application ready in <options=bold>[{$name}]</>. You can start your local development using:".PHP_EOL); $output->writeln('<fg=gray>➜</> <options=bold>cd '.$name.'</>'); @@ -348,23 +348,6 @@ protected function configureDefaultDatabaseConnection(string $directory, string ); } - /** - * Configure Composer's Script. - * - * @param string $directory - * @return void - */ - protected function configureComposerScript(string $directory): void - { - $this->composer->modify(function (array $content) { - if (windows_os()) { - $content['scripts']['dev'] = "npx concurrently -c \"#93c5fd,#c4b5fd,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"npm run dev\" --names='server,queue,vite'"; - } - - return $content; - }); - } - /** * Determine if the application is using Laravel 11 or newer. * @@ -777,6 +760,23 @@ protected function pushToGitHub(string $name, string $directory, InputInterface $this->runCommands($commands, $input, $output, workingPath: $directory, env: ['GIT_TERMINAL_PROMPT' => 0]); } + /** + * Configure the Composer "dev" script. + * + * @param string $directory + * @return void + */ + protected function configureComposerDevScript(string $directory): void + { + $this->composer->modify(function (array $content) { + if (windows_os()) { + $content['scripts']['dev'] = "npx concurrently -c \"#93c5fd,#c4b5fd,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"npm run dev\" --names='server,queue,vite'"; + } + + return $content; + }); + } + /** * Verify that the application does not already exist. *