Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Livewire stack #285

Merged
merged 1 commit into from
Sep 25, 2023
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
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