-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form Validation: required_with and required_without implementations #1837
Comments
Right, but if we check that What am I missing? |
For the above case, I can explain with the help of the campaign for which I kept the registration process same. |
Should I generate the PR for the same? |
I'm still confused. In the case of campaign, if they enter password, then confirm_password is required when using the required_with method. However, if they don't provide password, then confirm_password isn't required. Looking at the code, it first checks if If That matches the intended usage of the method, doesn't it? The tests in RulesTest.php support that unless there's a flaw in that test. |
In the Form Validation Class, required_with and required_without are validation methods where the descriptions and implementation are for fields exist in $data or not.
But according to logic, it should be like,
[confirm_password => required_with[password]]
The confirm_password is required when the password is there in data and its value is non-empty
[email => required_without[mobile]]
The email is required when the mobile is there in data and its value is empty or blank
The text was updated successfully, but these errors were encountered: