Level 88
I don't have the spark code in front of me, but spark should register this validator in one of the service providers. The CountryValidator class probably has a function looking like this
public function validateCountry($attribute, $value, $parameters);
The basic rule for this is that anything that comes after validate is the syntax of the rule as well. So for the above example the rule looks like this
$rules = [
'country' => 'required|country',
];
I hope this helps you to find the correct class so you can reuse the validation method ;)
1 like