Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
/ ValidationLocale Public archive

A set of Respect\Validation rules to work with localization

License

Notifications You must be signed in to change notification settings

Respect/ValidationLocale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Respect\ValidationLocale

A set of Respect\Validation rules to work with localization.

Country

  • v::country()
  • v::country(string $set)

Validates country codes according to ISO 3166-1.

v::country()->validate('BR'); //true

By default we choose ISO 3166-1 alpha-2 but you can use ISO 3166-1 alpha-3 and ISO 3166-1 numeric as well.

v::country('alpha-2')->validate('US'); //true
v::country('alpha-3')->validate('USA'); //true
v::country('numeric')->validate('840'); //true

This rule is case sensitive.

All data of this rule was extrated from GeoNames which is licensed under a Creative Commons Attribution 3.0 License.

CountrySubdivision

  • v::countrySubdivision(string $entry)

Validates country codes according to ISO 3166-2.

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

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

This rule is case sensitive.

All data of this rule was extrated from GeoNames which is licensed under a Creative Commons Attribution 3.0 License.

About

A set of Respect\Validation rules to work with localization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages