Skip to content

Commit 22629cd

Browse files
MarioPeriniMarioKüpfer
andauthored
[4.x] Adds option "dark" to jetstream installation (#259)
* [4.x] Adds option "dark" to jetstream installation * phpDocs @param added --------- Co-authored-by: MarioKüpfer <[email protected]>
1 parent 2f5dc26 commit 22629cd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/NewCommand.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function configure()
3131
->addOption('github', null, InputOption::VALUE_OPTIONAL, 'Create a new repository on GitHub', false)
3232
->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for')
3333
->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding')
34-
->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with dark mode support')
34+
->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support')
3535
->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support')
3636
->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding')
3737
->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)
9696
$teams = $input->getOption('teams') === true
9797
? (bool) $input->getOption('teams')
9898
: (new SymfonyStyle($input, $output))->confirm('Will your application use teams?', false);
99+
100+
$dark = $input->getOption('dark') === true
101+
? (bool) $input->getOption('dark')
102+
: (new SymfonyStyle($input, $output))->confirm('Would you like to install dark mode support?', false);
99103
} else {
100104
$output->write(PHP_EOL.' <fg=red> _ _
101105
| | | |
@@ -167,7 +171,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
167171
if ($installBreeze) {
168172
$this->installBreeze($directory, $stack, $testingFramework, $dark, $ssr, $input, $output);
169173
} elseif ($installJetstream) {
170-
$this->installJetstream($directory, $stack, $testingFramework, $teams, $input, $output);
174+
$this->installJetstream($directory, $stack, $testingFramework, $teams, $dark, $input, $output);
171175
} elseif ($input->getOption('pest')) {
172176
$this->installPest($directory, $input, $output);
173177
}
@@ -238,11 +242,12 @@ protected function installBreeze(string $directory, string $stack, string $testi
238242
* @param string $stack
239243
* @param string $testingFramework
240244
* @param bool $teams
245+
* @param bool $dark
241246
* @param \Symfony\Component\Console\Input\InputInterface $input
242247
* @param \Symfony\Component\Console\Output\OutputInterface $output
243248
* @return void
244249
*/
245-
protected function installJetstream(string $directory, string $stack, string $testingFramework, bool $teams, InputInterface $input, OutputInterface $output)
250+
protected function installJetstream(string $directory, string $stack, string $testingFramework, bool $teams, bool $dark, InputInterface $input, OutputInterface $output)
246251
{
247252
chdir($directory);
248253

@@ -252,6 +257,7 @@ protected function installJetstream(string $directory, string $stack, string $te
252257
PHP_BINARY.' artisan jetstream:install %s %s %s',
253258
$stack,
254259
$teams ? '--teams' : '',
260+
$dark ? '--dark' : '',
255261
$testingFramework == 'pest' ? '--pest' : '',
256262
)),
257263
]);

0 commit comments

Comments
 (0)