-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
RequiredWith not working as expected #853
Comments
I think it's same as #844 |
@scippio i feel the combination of the |
Yes. |
@scippio What I meant to say is your data class validation doesn't work because of the Optional type for both properties which translates to "sometimes". notice how the rules method work. |
So it's a laravel-data bug? Because Laravel works as expected. |
Duplicate indeed, fixed in next release! |
✏️ Describe the bug
I think there is a bad behaviour with RequiredWith attribute.
↪️ To Reproduce¨
✅ Expected behavior
I think there should be validate error like: "The city field is required when street is present.", but the request is accepted. The "rules" function with "required_with" works as expected.
🖥️ Versions
Laravel: 11
Laravel Data: 4.6.0
PHP: 8.3.6
The text was updated successfully, but these errors were encountered: