Curious if there is a simple way to do this.. Lets say for example I have a radio input that asks something like:
Do you own a car? (y) (n)
If yes is answered, then it would ask something like:
What type of car do you own?
Question would be - if I setup validation in Laravel, would I be able to set a rule stating that "What type of car do you own?" is only required if "Do you own a car" is selected as yes?
The way I envision this to be, within the public function rules, I'd have a conditional there, stating that if selected is yes, then return these rules. But if I have a form with over 80 fields, some of them will be required regardless of the conditionals, where some are conditional based. What would be the cleanest way I can pull this off without having to repeat the same rules under multiple if/else statements?