Validate country codes.

4.2.0 2023-02-17 08:16 UTC

This package is auto-updated.

Last update: 2024-06-17 11:07:52 UTC


README

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