-
Notifications
You must be signed in to change notification settings - Fork 29
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
Null not possible #23
Comments
Thank you for the bug report @schonhoff. The correct behaviour for receiving Could you tell me you Laravel and Postal code validation versions? |
Hello, no problem. I hope I can help you with this information:
My current validation rule for my postal code field:
As you noticed correctly bail shouldn't be necessary, but currently it is for me.
throws the error message. With the fixed code on my first post I don't get an error and the validation works like you described. |
Just a hint: on your src\Extensions\PostalCode Class you are using
I guess that this is the error. Maybe it is because of php 7.4 that I'm currently using. |
@schonhoff Could you review the changes I made in PR linked above? I think they should fix your issue. Note that validation will still pass if the given country has no pattern and null is passed |
@axlon copied the changes to my local system and it seems like it fixes the issue. Thanks for the fast fix! |
@schonhoff I've merged the changes and tagged it as v3.1.1 |
Hello,
I get the following error after trying to pass a 'null' to the postal code validation.
I fixed it by adding a
to my rule set but I think the package should check itself. Maybe you can add an additional test if the given postal code is null and return false. Here my possible workaround:
Thanks for the work and if I need to check in a pr, just ask :-)
The text was updated successfully, but these errors were encountered: