for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Rinvex\Country\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
class CountryServiceProvider extends ServiceProvider
{
/**
* {@inheritdoc}
*/
public function boot()
// Add country validation rule
Validator::extend('country', function ($attribute, $value) {
return array_key_exists(mb_strtolower($value), countries());
}, 'Country MUST be valid!');
}