Skip to content

laravel-validation-rules/country-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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