Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T13:01:26.000Z (8 months ago)
- Last Synced: 2024-04-24T18:42:14.888Z (7 months ago)
- Topics: country-codes, laravel, php, validation
- Language: PHP
- Homepage:
- Size: 132 KB
- Stars: 31
- Watchers: 5
- Forks: 11
- 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],
]);
```