respect-validation/docs/rules/SubdivisionCode.md
Henrique Moody 2610a380dc
Replace "LazyConsecutive" with "Consecutive"
With this and the Lazy rule, the LazyConsecutive lost its purpose.

While working on it, I did refactor the Domain rule a bit, but mainly to
check how this rule could behave.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-03-06 23:57:49 +01:00

1.1 KiB

SubdivisionCode

  • SubdivisionCode(string $countryCode)

Validates subdivision country codes according to ISO 3166-2.

The $countryCode must be a country in ISO 3166-1 alpha-2 format.

This rule requires sokil/php-isocodes and [php-isocodes-db-only][] to be installed.

v::subdivisionCode('BR')->validate('SP'); // true
v::subdivisionCode('US')->validate('CA'); // true

Categorization

  • ISO codes
  • Localization

Changelog

Version Description
3.0.0 Require sokil/php-isocodes and sokil/php-isocodes-db-only
1.0.0 Created

See also: