© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
32 replies
Kuldeep

Custom Validation

I'm having a 2 fields: (1) Price (2) Checkbox

Task 1) If the price is less than a specific amount then the checkbox check is required.
Task 2) Display a validation error message only if the price is less than a specific amount. Form submit will be allowed

I've done below code and it's not working properly:

Forms\Components\TextInput::make('price')
->label('Price'),
Forms\Components\Toggle::make('checkbox')
->label('Checkbox')
->rules(['required_if:price,(X Amount)']),

I've tried with custom rule but it's not working properly.

How can I do this?
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

Custom validation rules
FilamentFFilament / ❓┊help
3y ago
Custom repeater validation
FilamentFFilament / ❓┊help
3y ago
Custom Validation Title
FilamentFFilament / ❓┊help
3y ago
Custom validation message?
FilamentFFilament / ❓┊help
3y ago