laravel validation rules for multiple value

I am trying to validate form data using laravel validation. I want to validate some fields based on some conditions.

Suppose I have three input fields - input1, input2, input3

input3 is required or not it depends on input1 and input2.

  1. if the input1 value is 1, input3 is not required. N.B. what input2 is that doesn't matter.

  2. if the input2 value is 2, input3 is not required. N.B. what input1 is that doesn't matter.

Except for the above two cases, Input3 is required.

How can I do that?



Read more here: https://stackoverflow.com/questions/64950544/laravel-validation-rules-for-multiple-value

Content Attribution

This content was originally published by Mahfuz Shishir at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: