mirror of
https://github.com/Respect/Validation.git
synced 2024-06-21 06:55:07 +02:00
This commit will also remove the second argument from the constructor of the rule because there is no much use for that, instead if will simply perform the CountryCode validation. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
638 B
638 B
PostalCode
PostalCode(string $countryCode)
Validates whether the input is a valid postal code or not.
v::postalCode('BR')->validate('02179000'); // true
v::postalCode('BR')->validate('02179-000'); // true
v::postalCode('US')->validate('02179-000'); // false
v::postalCode('US')->validate('55372'); // true
v::postalCode('PL')->validate('99-300'); // true
Message template for this validator includes {{countryCode}}
.
Extracted from GeoNames.
Changelog
Version | Description |
---|---|
0.7.0 | Created |
See also: