© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
F alko

Custom repeater validation

Hey guys,

I have a repeater with some fields and a toggle like this:
Forms\Components\Repeater::make('someRepeater')
    ->schema([
        Forms\Components\Toggle::make('someToggle'),
    ]),
Forms\Components\Repeater::make('someRepeater')
    ->schema([
        Forms\Components\Toggle::make('someToggle'),
    ]),

I want to validate that only 1 of the fields can be active at the same time. Any tips on how to get this done?
Solution
I managed to use the
Form\Set $set
Form\Set $set
function to change the value back to false. I thought this wasn't working, but after updating van v3-alpha to v3-beta it started working 🙂
I can no-longer access the
->getOldState()
->getOldState()
on the parent, but I managed to get this working with the
->getState()
->getState()
function and checking for
$approvedCount > 1
$approvedCount > 1
.
Jump to solution
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

Form Repeater Validation
FilamentFFilament / ❓┊help
12mo ago
make repeater validation
FilamentFFilament / ❓┊help
2y ago
Custom Validation
FilamentFFilament / ❓┊help
3y ago
Validation in the Repeater field
FilamentFFilament / ❓┊help
2y ago