PHPackages                             brokeyourbike/country-validation-laravel - 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. brokeyourbike/country-validation-laravel

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

brokeyourbike/country-validation-laravel
========================================

Laravel country validation rules

0.1.2(2y ago)0548[1 PRs](https://github.com/brokeyourbike/country-validation-laravel/pulls)MPL-2.0PHPPHP ^8.0

Since Dec 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/brokeyourbike/country-validation-laravel)[ Packagist](https://packagist.org/packages/brokeyourbike/country-validation-laravel)[ RSS](/packages/brokeyourbike-country-validation-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (5)Used By (0)

country-validation-laravel
==========================

[](#country-validation-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/6fc02961f0be4135078c6614fe063b2a5164f90ab4cf9019e02824ab5800e030/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f62726f6b65796f757262696b652f636f756e7472792d76616c69646174696f6e2d6c61726176656c)](https://github.com/brokeyourbike/country-validation-laravel/releases)[![Total Downloads](https://camo.githubusercontent.com/6fb87b80c52c3c1c7913d80ec0889e8d3067e995119168db0e71a94bfa7427af/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b65796f757262696b652f636f756e7472792d76616c69646174696f6e2d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/brokeyourbike/country-validation-laravel)[![Maintainability](https://camo.githubusercontent.com/9579c6e4f4076673f7fd323c203c0125281973f999674af46144bb7ddc3db8ea/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33363061313231616631656232643031386362622f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/brokeyourbike/country-validation-laravel/maintainability)[![Test Coverage](https://camo.githubusercontent.com/280522a55702668b2a75b280c230698e4608c1e4feb823d1f54527cf358f8c08/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33363061313231616631656232643031386362622f746573745f636f766572616765)](https://codeclimate.com/github/brokeyourbike/country-validation-laravel/test_coverage)

Laravel country validation rules

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

[](#installation)

```
composer require brokeyourbike/country-validation-laravel
```

Usage
-----

[](#usage)

```
use Illuminate\Foundation\Http\FormRequest;
use BrokeYourBike\CountryValidation\IsValidCountryCodeAlpha2;
use BrokeYourBike\CountryValidation\IsValidCountryCodeAlpha3;

class ExampleRequest extends FormRequest
{
    public function rules()
    {
        return [
            'country_alpha2' => [
                'required',
                'string',
                'size:2',
                new IsValidCountryCodeAlpha2(),
            ],
            'country_alpha3' => [
                'required',
                'string',
                'size:3',
                new IsValidCountryCodeAlpha3(),
            ],
        ];
    }
}
```

Authors
-------

[](#authors)

- [Ivan Stasiuk](https://github.com/brokeyourbike) | [Twitter](https://twitter.com/brokeyourbike) | [LinkedIn](https://www.linkedin.com/in/brokeyourbike) | [stasi.uk](https://stasi.uk)

License
-------

[](#license)

[Mozilla Public License v2.0](https://github.com/brokeyourbike/country-validation-laravel/blob/main/LICENSE)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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.

###  Release Activity

Cadence

Every ~254 days

Total

3

Last Release

1094d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/114f3c6e8506e0bba763451e8e4bcc3e94d662c2dce982a910b5d7b3444593cf?d=identicon)[brokeyourbike](/maintainers/brokeyourbike)

---

Top Contributors

[![brokeyourbike](https://avatars.githubusercontent.com/u/1554371?v=4)](https://github.com/brokeyourbike "brokeyourbike (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

hacktoberfestlaravellaravel-8laravel-8-packagelaravel-packagephpphp8validation

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[propaganistas/laravel-phone

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

3.0k35.7M107](/packages/propaganistas-laravel-phone)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[illuminate/validation

The Illuminate Validation package.

18936.7M1.4k](/packages/illuminate-validation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)

PHPackages © 2026

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