PHPackages                             laravel-validation-rules/country-codes - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. laravel-validation-rules/country-codes

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

laravel-validation-rules/country-codes
======================================

Validate country codes.

4.2.0(3y ago)34499.6k↓65.5%17[2 PRs](https://github.com/laravel-validation-rules/country-codes/pulls)Apache-2.0PHPPHP ^7.3|^8.0CI failing

Since Sep 10Pushed 1y ago4 watchersCompare

[ Source](https://github.com/laravel-validation-rules/country-codes)[ Packagist](https://packagist.org/packages/laravel-validation-rules/country-codes)[ RSS](/packages/laravel-validation-rules-country-codes/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

Country Codes
=============

[](#country-codes)

Validates 2 &amp; 3 character country codes.

 [ ![](https://camo.githubusercontent.com/554495f3bf1ff817698f29549a640fcc973fa4753014dec33b5bcb3fc7b3a881/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c61726176656c2d76616c69646174696f6e2d72756c65732f636f756e7472792d636f6465732f43493f7374796c653d666c61742d737175617265) ](https://github.com/laravel-validation-rules/country-codes/actions) [ ![](https://camo.githubusercontent.com/5e0bf329af9b0208bda1e5ebb65fab32d0086cd0dfaec0e5eac181de228a8a3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c61726176656c2d76616c69646174696f6e2d72756c65732f636f756e7472792d636f6465732e7376673f7374796c653d666c61742d737175617265) ](https://github.com/laravel-validation-rules/country-codes/blob/master/LICENSE)

Installation
------------

[](#installation)

```
composer require laravel-validation-rules/country-codes
```

Usage
-----

[](#usage)

Validate a 2 character country code.

```
use LVR\CountryCode\Two;

$request->validate([
    'country' => ['required', new Two],
]);
```

Validate a 3 character country code.

```
use LVR\CountryCode\Three;

$request->validate([
    'country' => ['required', new Three],
]);
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~248 days

Recently: every ~220 days

Total

9

Last Release

1234d ago

Major Versions

V1.1.0 → v2.0.02019-09-04

2.2.0 → v3.0.02021-01-25

v3.0.0 → 4.0.02022-03-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/4aa56557de1c571ed78fb23fda585f3fd461425339df673fb293c609a6719c81?d=identicon)[clarkeash](/maintainers/clarkeash)

![](https://avatars.githubusercontent.com/u/254889?v=4)[Scott](/maintainers/ssx)[@ssx](https://github.com/ssx)

---

Top Contributors

[![clarkeash](https://avatars.githubusercontent.com/u/1612186?v=4)](https://github.com/clarkeash "clarkeash (10 commits)")[![ssx](https://avatars.githubusercontent.com/u/254889?v=4)](https://github.com/ssx "ssx (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (1 commits)")[![Kaz-](https://avatars.githubusercontent.com/u/7923839?v=4)](https://github.com/Kaz- "Kaz- (1 commits)")[![DeepDiver1975](https://avatars.githubusercontent.com/u/1005065?v=4)](https://github.com/DeepDiver1975 "DeepDiver1975 (1 commits)")[![bilfeldt](https://avatars.githubusercontent.com/u/30228807?v=4)](https://github.com/bilfeldt "bilfeldt (1 commits)")[![keatliang2005](https://avatars.githubusercontent.com/u/473990?v=4)](https://github.com/keatliang2005 "keatliang2005 (1 commits)")

---

Tags

country-codeslaravelphpvalidationlaravelvalidationcountry

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravel-validation-rules-country-codes/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-validation-rules-country-codes/health.svg)](https://phpackages.com/packages/laravel-validation-rules-country-codes)
```

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k39.7M146](/packages/propaganistas-laravel-phone)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k16.9M109](/packages/bensampo-laravel-enum)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel

3893.6M1](/packages/axlon-laravel-postal-code-validation)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[sandermuller/laravel-fluent-validation

Fluent validation rule builders for Laravel

20719.1k4](/packages/sandermuller-laravel-fluent-validation)

PHPackages © 2026

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