From a77b86aa9ebce81cb0fb11892e3afb7245c66b1f Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Mon, 27 Oct 2025 17:23:03 +0530 Subject: [PATCH 1/6] Add Laravel Boost installation and configuration options --- src/NewCommand.php | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/NewCommand.php b/src/NewCommand.php index 8a0e3b9..29cb5d2 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -68,6 +68,7 @@ protected function configure() ->addOption('pnpm', null, InputOption::VALUE_NONE, 'Install and build NPM dependencies via PNPM') ->addOption('bun', null, InputOption::VALUE_NONE, 'Install and build NPM dependencies via Bun') ->addOption('yarn', null, InputOption::VALUE_NONE, 'Install and build NPM dependencies via Yarn') + ->addOption('boost', null, InputOption::VALUE_NONE, 'Install Laravel Boost for AI-assisted coding') ->addOption('using', null, InputOption::VALUE_OPTIONAL, 'Install a custom starter kit from a community maintained package') ->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists'); } @@ -174,6 +175,12 @@ protected function interact(InputInterface $input, OutputInterface $output) default: 'Pest', ) === 'Pest'); } + + if (! $input->getOption('boost')) { + $input->setOption('boost', confirm( + label: 'Do you want to install and configure Laravel Boost?', + )); + } } /** @@ -498,6 +505,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->installPest($directory, $input, $output); } + if ($input->getOption('boost')) { + $this->installBoost($directory, $input, $output); + } + if ($input->getOption('github') !== false) { $this->pushToGitHub($name, $directory, $input, $output); $output->writeln(''); @@ -527,6 +538,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->runCommands([$packageManager->installCommand(), $packageManager->buildCommand()], $input, $output, workingPath: $directory); } + if ($input->getOption('boost')) { + $this->configureBoostComposerScript(); + $this->commitChanges('Configure Boost post-update script', $directory, $input, $output); + } + $output->writeln(" INFO Application ready in [{$name}]. You can start your local development using:".PHP_EOL); $output->writeln('cd '.$name.''); @@ -882,6 +898,31 @@ protected function installPest(string $directory, InputInterface $input, OutputI $this->commitChanges('Install Pest', $directory, $input, $output); } + /** + * Install Laravel Boost into the application. + * + * @param string $directory + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @return void + */ + protected function installBoost(string $directory, InputInterface $input, OutputInterface $output): void + { + $composerBinary = $this->findComposer(); + + $commands = [ + $composerBinary.' require laravel/boost --dev', + trim(sprintf( + $this->phpBinary().' artisan boost:install %s', + ! $input->isInteractive() ? '--no-interaction' : '', + )), + ]; + + $this->runCommands($commands, $input, $output, workingPath: $directory); + + $this->commitChanges('Install Laravel Boost', $directory, $input, $output); + } + /** * Create a Git repository and commit the base Laravel skeleton. * @@ -987,6 +1028,20 @@ protected function configureComposerScripts(NodePackageManager $packageManager): }); } + /** + * Add boost:update command in a composer script + * + * @return void + */ + protected function configureBoostComposerScript(): void + { + $this->composer->modify(function (array $content) { + $content['scripts']['post-update-cmd'][] = '@php artisan boost:update --ansi'; + + return $content; + }); + } + /** * Verify that the application does not already exist. * From fd7962ad3f619e3f4a36cc148df838a6dcab9c9b Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Mon, 27 Oct 2025 17:33:18 +0530 Subject: [PATCH 2/6] Fix Style --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 29cb5d2..05f5a55 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -1029,7 +1029,7 @@ protected function configureComposerScripts(NodePackageManager $packageManager): } /** - * Add boost:update command in a composer script + * Add boost:update command in a composer script. * * @return void */ From 03f3f2bac8a6076cfacfc8e49994147494cfca75 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 27 Oct 2025 10:58:12 -0500 Subject: [PATCH 3/6] formatting --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 05f5a55..8144236 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -1029,7 +1029,7 @@ protected function configureComposerScripts(NodePackageManager $packageManager): } /** - * Add boost:update command in a composer script. + * Add boost:update command to the post-update-cmd Composer script. * * @return void */ From da8704de359562716c625e0a3a68c54c869d8378 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 27 Oct 2025 10:59:14 -0500 Subject: [PATCH 4/6] Clarify 'boost' option description in NewCommand.php Updated the description for the 'boost' option to clarify its purpose. --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 8144236..4b8c8fc7 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -68,7 +68,7 @@ protected function configure() ->addOption('pnpm', null, InputOption::VALUE_NONE, 'Install and build NPM dependencies via PNPM') ->addOption('bun', null, InputOption::VALUE_NONE, 'Install and build NPM dependencies via Bun') ->addOption('yarn', null, InputOption::VALUE_NONE, 'Install and build NPM dependencies via Yarn') - ->addOption('boost', null, InputOption::VALUE_NONE, 'Install Laravel Boost for AI-assisted coding') + ->addOption('boost', null, InputOption::VALUE_NONE, 'Install Laravel Boost to improve AI assisted coding') ->addOption('using', null, InputOption::VALUE_OPTIONAL, 'Install a custom starter kit from a community maintained package') ->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists'); } From 9d092216df7875f92838b16b40c302bf30c55cef Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 27 Oct 2025 10:59:43 -0500 Subject: [PATCH 5/6] Update NewCommand.php --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 4b8c8fc7..dbbea9a 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -178,7 +178,7 @@ protected function interact(InputInterface $input, OutputInterface $output) if (! $input->getOption('boost')) { $input->setOption('boost', confirm( - label: 'Do you want to install and configure Laravel Boost?', + label: 'Do you want to install and configure Laravel Boost to improve AI assisted coding?', )); } } From c9345744a45521c3efdce252166131d3206cd765 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 27 Oct 2025 10:59:59 -0500 Subject: [PATCH 6/6] Update NewCommand.php --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index dbbea9a..aa5ff39 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -178,7 +178,7 @@ protected function interact(InputInterface $input, OutputInterface $output) if (! $input->getOption('boost')) { $input->setOption('boost', confirm( - label: 'Do you want to install and configure Laravel Boost to improve AI assisted coding?', + label: 'Do you want to install Laravel Boost to improve AI assisted coding?', )); } }