laravel-validation-rules / country-codes by clarkeash

Validate country codes.
383,759
31
5
Package Data
Maintainer Username: clarkeash
Maintainer Contact: me@ashleyclarke.me (Ashley Clarke)
Package Create Date: 2017-09-10
Package Last Update: 2024-07-26
Home Page:
Language: PHP
License: Apache-2.0
Last Refreshed: 2025-02-21 03:08:54
Package Statistics
Total Downloads: 383,759
Monthly Downloads: 8,534
Daily Downloads: 262
Total Stars: 31
Total Watchers: 5
Total Forks: 14
Total Open Issues: 2

Country Codes

Validates 2 & 3 character country codes.

Installation

composer require laravel-validation-rules/country-codes

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],
]);