From 731611ab17d6016f1210e74ce719275ebe0aa39e Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Mon, 25 Sep 2023 18:02:16 +0200 Subject: [PATCH] Add the Livewire stack option to Breeze --- src/NewCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index bca112e4..20cd9258 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -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', @@ -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, @@ -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).'.'); }