max-validator
max-validator copied to clipboard
Can't compare fields?
It would be very useful for password and confirm password fields. Or for example, a field called salary
and then a field called desiredSalary
that has a minimum of the salary
field.
You might mention fields like $fieldName
or @fieldName
.
Here is an example for the idea
{
password: 'required|min:8',
confirmPassword: 'required|equals:$password',
salary: 'numeric',
desiredSalary: 'numeric|min:$salary'
}