Validate country codes.

4.2.0 2023-02-17 08:16 UTC

This package is auto-updated.

Last update: 2024-10-26 07:00:38 UTC


README

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