PHPackages                             respect/validation-locale - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. respect/validation-locale

AbandonedArchivedLibrary[Localization &amp; i18n](/categories/localization)

respect/validation-locale
=========================

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

143.6k2[1 PRs](https://github.com/Respect/ValidationLocale/pulls)PHP

Since Jun 19Pushed 4y ago3 watchersCompare

[ Source](https://github.com/Respect/ValidationLocale)[ Packagist](https://packagist.org/packages/respect/validation-locale)[ RSS](/packages/respect-validation-locale/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Respect\\ValidationLocale
=========================

[](#respectvalidationlocale)

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

Country
-------

[](#country)

- `v::country()`
- `v::country(string $set)`

Validates country codes according to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1 "ISO 3166-1").

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

By default we choose [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 "ISO 3166-1 alpha-2") but you can use [ISO 3166-1 alpha-3](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3 "ISO 3166-1 alpha-3")and [ISO 3166-1 numeric](http://en.wikipedia.org/wiki/ISO_3166-1_numeric "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](http://www.geonames.org "GetNames") which is licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0 "Creative Commons Attribution 3.0 License").

CountrySubdivision
------------------

[](#countrysubdivision)

- `v::countrySubdivision(string $entry)`

Validates country codes according to [ISO 3166-2](http://en.wikipedia.org/wiki/ISO_3166-2 "ISO 3166-2").

The `$entry` must be a country in [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 "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](http://www.geonames.org "GetNames") which is licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0 "Creative Commons Attribution 3.0 License").

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202642?v=4)[Alexandre Gomes Gaigalas](/maintainers/alganet)[@alganet](https://github.com/alganet)

![](https://avatars.githubusercontent.com/u/154023?v=4)[Henrique Moody](/maintainers/henriquemoody)[@henriquemoody](https://github.com/henriquemoody)

![](https://www.gravatar.com/avatar/4343df4adee634d5953da73aa5b61e4af61dbd37bf4e97449240c8a32c142dc5?d=identicon)[augustohp](/maintainers/augustohp)

---

Top Contributors

[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (258 commits)")

### Embed Badge

![Health badge](/badges/respect-validation-locale/health.svg)

```
[![Health](https://phpackages.com/badges/respect-validation-locale/health.svg)](https://phpackages.com/packages/respect-validation-locale)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
