[ 'email' => 'bail|required_if:status_id,2|email' ];Validation passes succesfully.
Validator throws error The email must be a valid email address.
Why do you think the validator should pass? Bail stops further validation if the first rule fails, in your example the first rule was skipped because status_id <> 2, so the actual first rule hit was email since the required_if was skipped.
But, how i can check email only if previous rules passed, i.e i want to check email only if status_id = 2?
Advice me plz 馃槂
Most helpful comment
take a look at: http://themsaid.com/laravel-advanced-validation-conditionally-adding-rules-20170110/
;)