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: about 1 year ago
JSON representation
Validates 2 & 3 character country codes.
- Host: GitHub
- URL: https://github.com/laravel-validation-rules/country-codes
- Owner: laravel-validation-rules
- License: apache-2.0
- Created: 2017-09-10T12:58:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T06:27:22.000Z (almost 2 years ago)
- Last Synced: 2025-06-16T17:20:25.967Z (about 1 year ago)
- Topics: country-codes, laravel, php, validation
- Language: PHP
- Homepage:
- Size: 133 KB
- Stars: 31
- Watchers: 4
- Forks: 18
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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],
]);
```