I have a disclosure form that I only need to validate 2 fields out of six based on if the required question asked (radio button) is YES.
So if yes then,
A> company1 and details1 are required if any one of these 2 fields have text and the other four fields are not required (company2, details2, comapny3, details3) OR;
B> company2 and details2 are required if any one of these 2 fields have text and the other four fields are not required (company1, details1, comapny3, details3) OR;
C> company3 and details3 are required if any one of these 2 fields have text and the other four fields are not required (company1, details1, comapny2, details2)
Thanks
Check out required_if validator rule and required_with, required_without
https://laravel.com/docs/6.x/validation#available-validation-rules
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community