laravel-validation-rules / country-codes by clarkeash

Validate country codes.
297,019
31
5
Package Data
Maintainer Username: clarkeash
Maintainer Contact: me@ashleyclarke.me (Ashley Clarke)
Package Create Date: 2017-09-10
Package Last Update: 2024-03-21
Home Page:
Language: PHP
License: Apache-2.0
Last Refreshed: 2024-03-27 03:11:47
Package Statistics
Total Downloads: 297,019
Monthly Downloads: 9,332
Daily Downloads: 463
Total Stars: 31
Total Watchers: 5
Total Forks: 10
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],
]);