Reputation: 512
I have an form where user will post only an email address. I want to validate this input like:
if that email exists in the table, then a specific column's (e.g. is_valid) data must be null.
if the email doesn't exists then should be validated
I've got solution for the first condition, but can't find anything to combine both.
For first condition my solution:
Rule::exists('table_name')->where(function ($query) {
$query->where('is_valid', null);
});
How to write a rule for both conditions?
Upvotes: 0
Views: 74