Skip to content

Commit

Permalink
Add the Livewire stack option to Breeze
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Sep 25, 2023
1 parent c0febf7 commit 731611a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ protected function promptForBreezeOptions(InputInterface $input)
label: 'Which Breeze stack would you like to install?',
options: [
'blade' => 'Blade',
'livewire' => 'Livewire 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 ($input->getOption('stack') === 'blade' && ! $input->getOption('dark')) {
} elseif (in_array($input->getOption('stack'), ['blade', 'livewire']) && ! $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', 'react', 'vue', 'api'])) {
if (! in_array($input->getOption('stack'), $stacks = ['blade', 'livewire', 'react', 'vue', 'api'])) {
throw new \InvalidArgumentException("Invalid Breeze stack [{$input->getOption('stack')}]. Valid options are: ".implode(', ', $stacks).'.');
}

Expand Down

0 comments on commit 731611a

Please sign in to comment.