Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/laravel-validation-rules/country-codes

Validates 2 & 3 character country codes.
https://github.com/laravel-validation-rules/country-codes

country-codes laravel php validation

Last synced: 3 months ago
JSON representation

Validates 2 & 3 character country codes.

Awesome Lists containing this project

README

        

# Country Codes

Validates 2 & 3 character country codes.








## Installation

```bash
composer require laravel-validation-rules/country-codes
```

## Usage

Validate a 2 character country code.

```php
use LVR\CountryCode\Two;

$request->validate([
'country' => ['required', new Two],
]);
```

Validate a 3 character country code.

```php
use LVR\CountryCode\Three;

$request->validate([
'country' => ['required', new Three],
]);
```