-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
@rekrios
Description
Hi.
You can get broken error list with LaravelJsonApi::showValidatorFailures() when your Clousure/CustomRuleClass returns array as error message coz then there are different keys.
https://monosnap.com/file/VOFYTBPnVOQoC7DTrP8ZwMhDuoqwA7
- rule and answer in different places
- maybe try to get array's associative key when we have ordinary Closure ? Coz 'closure-validation-rule' is not very informative. For example,
$rules = ['rulesName' => function(...) {...}]
The only way for now, if u want to get normal info in 'rule' - use custom rule. Coz there are 'get_class($rule)' interpreter.
$rules = [new CustomRule()]
- coz of problem with diffrerent keys (1), some rules are missed
P.S. maybe i will fix it myself if we will come to some consensus