Using a wizard as a modal form

use Filament\Forms\Components\MarkdownEditor;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\Wizard\Step;

Action::make('create')
->steps([
Step::make('Name')
->description('Give the category a unique name')
->schema([
CheckboxList::make('technologies')
->options($data),
])
->afterValidation(function () {
// ...

if (true) {
throw new Halt();
}
}),
Step::make('Description')
->description('Add some extra details')
->schema([
MarkdownEditor::make('description'),
]),
Step::make('Visibility')
->description('Control who can view it')
->schema([
Toggle::make('is_visible')
->label('Visible to customers.')
->default(true),
]),
])
use Filament\Forms\Components\MarkdownEditor;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\Wizard\Step;

Action::make('create')
->steps([
Step::make('Name')
->description('Give the category a unique name')
->schema([
CheckboxList::make('technologies')
->options($data),
])
->afterValidation(function () {
// ...

if (true) {
throw new Halt();
}
}),
Step::make('Description')
->description('Add some extra details')
->schema([
MarkdownEditor::make('description'),
]),
Step::make('Visibility')
->description('Control who can view it')
->schema([
Toggle::make('is_visible')
->label('Visible to customers.')
->default(true),
]),
])
How can I check if at least 1 element is clicked on the checboxlist. If nothing is selected the next button should be disabled. Atm halt only blocks you from going to the next button, but its not disabled.
2 Replies
Matthew
MatthewOP6mo ago
Why is
->nextAction(
fn (Action $action) => $action->label('Next step'),
)
->nextAction(
fn (Action $action) => $action->label('Next step'),
)
not available just like in the wizard?
LeandroFerreira
LeandroFerreira5mo ago
why not ->minItems(1) in the CheckboxList ?
Want results from more Discord servers?
Add your server