I think you need to create some custom logic to get it working, I suspect you could start with the
Rule:forEach as described here: https://laravel.com/docs/9.x/validation#accessing-nested-array...
sidenote: I have updated your post to make the code block more readable.
Thank you, for coming up with the suggestion. I believe
Rule:forEach is not available in previous versions of laravel. I tried to use
Rule::when as well which also is absent in my laravel version.
@prithvidev1 - How did you fix this issue? I am working on something similar. Please guide us.
I assume Rule:forEach was not included in earlier Laravel releases. https://laravel.io/forum/conditional-validation-with-dependency-to-other-fields-backrooms game
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us