Closed Propaganistas closed 6 years ago
Hi
A rather important heads up: according to the official docs Laravel also supports Rule objects and closures in a rules array:
use App\Rules\Uppercase; $rules = [ 'required', new Uppercase, function($attribute, $value, $fail) { if ($value === 'foo') { return $fail($attribute.' is invalid.'); } }, ];
The package currently errors in the injectUniqueIdentifier() method. When exploding the rule, it is assumed the rule is always a string:
injectUniqueIdentifier()
$parameters = explode(':', $rule);
I just ran into this issue and thought I'd let you know. I'm not sending in a PR; seems a rather easy fix to me so go ahead.
Thanks for reporting this. Unfortunately I don't have the time to dedicate to fixing this implementation at the moment but I'm happy to accept any PR that can sort it out.
Hi
A rather important heads up: according to the official docs Laravel also supports Rule objects and closures in a rules array:
The package currently errors in the
injectUniqueIdentifier()
method. When exploding the rule, it is assumed the rule is always a string:I just ran into this issue and thought I'd let you know. I'm not sending in a PR; seems a rather easy fix to me so go ahead.