Laravel country validation rules
brokeyourbike/country-validation-laravel is a Laravel package for laravel country validation rules.
It currently has 0 GitHub stars and 548 downloads on Packagist (latest version 0.1.2).
Install it with composer require brokeyourbike/country-validation-laravel.
Discover more Laravel packages by brokeyourbike
or browse all Laravel packages to compare alternatives.
Last updated
Laravel country validation rules
composer require brokeyourbike/country-validation-laravel
use Illuminate\Foundation\Http\FormRequest;
use BrokeYourBike\CountryValidation\IsValidCountryCodeAlpha2;
use BrokeYourBike\CountryValidation\IsValidCountryCodeAlpha3;
class ExampleRequest extends FormRequest
{
public function rules()
{
return [
'country_alpha2' => [
'required',
'string',
'size:2',
new IsValidCountryCodeAlpha2(),
],
'country_alpha3' => [
'required',
'string',
'size:3',
new IsValidCountryCodeAlpha3(),
],
];
}
}