© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
mohdaftab

Dynamically update rules based on Select option

Hello,

Is it possible to change required to true of false for other form fields based on Select option ?

For example

I have a Select field named service with options hourly and point-to-point
and I have some fields like number_of_hours, point_from, point_to

the number_of_hours is required when hourly is selected
point_from is required all the time
point_to is required when point-to-point is selected.

It works great with the normal validation rules like requiredIf('service','hourly');
but I am trying to make it work a bit dynamically using the config values which users can set themselves for their forms.

so basically what I am trying to do is to set the required rule within afterStateUpdated for Select field.

Please check the image attached.

Thank you
image.png
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

How can I dynamically update my Select options based on an API
FilamentFFilament / ❓┊help
3y ago
Dynamic fields based on a select option
FilamentFFilament / ❓┊help
3y ago
Dynamic Fields Based on Select Option Issue
FilamentFFilament / ❓┊help
3y ago
How to dynamically update Province select based on Region select in Filament Tables filter?
FilamentFFilament / ❓┊help
15mo ago