Skip to content

Commit

Permalink
Adjusts new command with new Breeze options (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored Oct 9, 2023
1 parent 04e1bbf commit ab00a74
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,9 @@ protected function promptForBreezeOptions(InputInterface $input)
$input->setOption('stack', select(
label: 'Which Breeze stack would you like to install?',
options: [
'blade' => 'Blade',
'livewire' => 'Livewire with Alpine',
'blade' => 'Blade with Alpine',
'livewire' => 'Livewire (Volt Class API) with Alpine',
'livewire-functional' => 'Livewire (Volt Functional API) with Alpine',
'react' => 'React with Inertia',
'vue' => 'Vue with Inertia',
'api' => 'API only',
Expand All @@ -414,7 +415,7 @@ protected function promptForBreezeOptions(InputInterface $input)
$input->getOption('typescript') ? 'typescript' : null,
]),
))->each(fn ($option) => $input->setOption($option, true));
} elseif (in_array($input->getOption('stack'), ['blade', 'livewire']) && ! $input->getOption('dark')) {
} elseif (in_array($input->getOption('stack'), ['blade', 'livewire', 'livewire-functional']) && ! $input->getOption('dark')) {
$input->setOption('dark', confirm(
label: 'Would you like dark mode support?',
default: false,
Expand Down Expand Up @@ -464,7 +465,7 @@ protected function promptForJetstreamOptions(InputInterface $input)
protected function validateStackOption(InputInterface $input)
{
if ($input->getOption('breeze')) {
if (! in_array($input->getOption('stack'), $stacks = ['blade', 'livewire', 'react', 'vue', 'api'])) {
if (! in_array($input->getOption('stack'), $stacks = ['blade', 'livewire', 'livewire-functional', 'react', 'vue', 'api'])) {
throw new \InvalidArgumentException("Invalid Breeze stack [{$input->getOption('stack')}]. Valid options are: ".implode(', ', $stacks).'.');
}

Expand Down

0 comments on commit ab00a74

Please sign in to comment.