© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
1 reply
o.m

Conditionally display either checkbox or radio button in Repeater

Is it possible to display either radio button or checkbox in a repeater depending on what other field was selected?

I did this but doesn't work

Repeater::make('options')
    ->label('Possible Answers')
    ->relationship('options')
    ->reorderable()
    ->schema([
      Forms\Components\Radio::make('is_correct')
          ->label('Correct Answer')
          ->hidden(fn(callable $get) = > $get('../../type') !=
                   = 'single_choice'),
      Checkbox::make('is_correct')
          ->label('Correct Answer')
          ->hidden(fn(callable $get) = > $get('../../type') !=
                   = 'multiple_choice'),
      TextInput::make('label')->label('Answer Label')->required(true),
    ]),
Repeater::make('options')
    ->label('Possible Answers')
    ->relationship('options')
    ->reorderable()
    ->schema([
      Forms\Components\Radio::make('is_correct')
          ->label('Correct Answer')
          ->hidden(fn(callable $get) = > $get('../../type') !=
                   = 'single_choice'),
      Checkbox::make('is_correct')
          ->label('Correct Answer')
          ->hidden(fn(callable $get) = > $get('../../type') !=
                   = 'multiple_choice'),
      TextInput::make('label')->label('Answer Label')->required(true),
    ]),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Add + button next to select button in repeater conditionally
FilamentFFilament / ❓┊help
2y ago
Repeater: How can I conditionally show/hide Delete button in Repeater?
FilamentFFilament / ❓┊help
2y ago
Repeater open conditionally.
FilamentFFilament / ❓┊help
4mo ago
repeater checkbox problem
FilamentFFilament / ❓┊help
3y ago