From f0d627eb114d04c84a32470b2e63e07af2805217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MarioK=C3=BCpfer?= Date: Thu, 23 Feb 2023 13:50:20 +0100 Subject: [PATCH 1/2] [4.x] Adds option "dark" to jetstream installation --- src/NewCommand.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 4021bb1e..4cc8b8ce 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -31,7 +31,7 @@ protected function configure() ->addOption('github', null, InputOption::VALUE_OPTIONAL, 'Create a new repository on GitHub', false) ->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for') ->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding') - ->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with dark mode support') + ->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support') ->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support') ->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding') ->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Breeze / Jetstream stack that should be installed') @@ -96,6 +96,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $teams = $input->getOption('teams') === true ? (bool) $input->getOption('teams') : (new SymfonyStyle($input, $output))->confirm('Will your application use teams?', false); + + $dark = $input->getOption('dark') === true + ? (bool) $input->getOption('dark') + : (new SymfonyStyle($input, $output))->confirm('Would you like to install dark mode support?', false); } else { $output->write(PHP_EOL.' _ _ | | | | @@ -167,7 +171,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($installBreeze) { $this->installBreeze($directory, $stack, $testingFramework, $dark, $ssr, $input, $output); } elseif ($installJetstream) { - $this->installJetstream($directory, $stack, $testingFramework, $teams, $input, $output); + $this->installJetstream($directory, $stack, $testingFramework, $teams, $dark, $input, $output); } elseif ($input->getOption('pest')) { $this->installPest($directory, $input, $output); } @@ -242,7 +246,7 @@ protected function installBreeze(string $directory, string $stack, string $testi * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void */ - protected function installJetstream(string $directory, string $stack, string $testingFramework, bool $teams, InputInterface $input, OutputInterface $output) + protected function installJetstream(string $directory, string $stack, string $testingFramework, bool $teams, bool $dark, InputInterface $input, OutputInterface $output) { chdir($directory); @@ -252,6 +256,7 @@ protected function installJetstream(string $directory, string $stack, string $te PHP_BINARY.' artisan jetstream:install %s %s %s', $stack, $teams ? '--teams' : '', + $dark ? '--dark' : '', $testingFramework == 'pest' ? '--pest' : '', )), ]); From 517f5e449fb0a20b4342d06d722ff2a962d46076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MarioK=C3=BCpfer?= Date: Thu, 23 Feb 2023 14:02:52 +0100 Subject: [PATCH 2/2] phpDocs @param added --- src/NewCommand.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/NewCommand.php b/src/NewCommand.php index 4cc8b8ce..524da096 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -242,6 +242,7 @@ protected function installBreeze(string $directory, string $stack, string $testi * @param string $stack * @param string $testingFramework * @param bool $teams + * @param bool $dark * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void