laravel-validation-rules / country-codes
Validate country codes.
Installs: 366 866
Dependents: 0
Suggesters: 0
Security: 0
Stars: 31
Watchers: 5
Forks: 14
Open Issues: 2
Requires
- php: ^7.3|^8.0
- illuminate/contracts: ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0
- league/iso3166: ^3.0|^4.0
Requires (Dev)
- orchestra/testbench: ^3.5|^4.0|^5.0|^7.0|^8.0
- phpunit/phpunit: ^7.0|^8.0|^9.0|^10.0
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], ]);