Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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.' <fg=red> _ _
| | | |
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -238,11 +242,12 @@ 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
*/
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);

Expand All @@ -252,6 +257,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' : '',
)),
]);
Expand Down