protected function addValidators()
    {
        foreach (config('countries.validation.rules') as $ruleName => $countryAttribute) {
            if (is_int($ruleName)) {
                $ruleName = $countryAttribute;
            }

            Validator::extend($ruleName, function ($attribute, $value) use ($countryAttribute) {
                return ! CountriesFacade::where($countryAttribute, $value)->isEmpty();
            }, 'The :attribute must be a valid '.$ruleName.'.');
        }
    }
protected function addValidators()
    {
        foreach (config('countries.validation.rules') as $ruleName => $countryAttribute) {
            if (is_int($ruleName)) {
                $ruleName = $countryAttribute;
            }

            Validator::extend($ruleName, function ($attribute, $value) use ($countryAttribute) {
                return ! CountriesFacade::where($countryAttribute, $value)->isEmpty();
            }, 'The :attribute must be a valid '.$ruleName.'.');
        }
    }
protected function addValidators ( ) { foreach ( config ( 'countries.validation.rules' ) as $ ruleName => $ countryAttribute ) { if ( is_int ( $ ruleName ) ) { $ ruleName = $ countryAttribute ; } Validator :: extend ( $ ruleName , function ( $ attribute , $ value ) use ( $ countryAttribute ) { return ! CountriesFacade :: where ( $ countryAttribute , $ value ) -> isEmpty ( ) ; } , 'The :attribute must be a valid ' . $ ruleName . '.' ) ; } }
Add validators.
Add validators .