Validate country codes.

v3.0.0 2021-01-25 14:59 UTC

README

Validates 2 & 3 character country codes.

68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c61726176656c2d76616c69646174696f6e2d72756c65732f636f756e7472792d636f6465732f43493f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c61726176656c2d76616c69646174696f6e2d72756c65732f636f756e7472792d636f6465732e7376673f7374796c653d666c61742d737175617265

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