validatorjs
validatorjs copied to clipboard
Detect which rule not passed?
How can i detect which rule is not passed? `
for (let field in v.errors.all()) {
fields.push({
field,
value: data[field],
message: v.errors.first(field),
rule: 'not passed rule' /// what to write here?
})
}
@alisherafat In an upcoming release, we are going to adjust how it validator returns objects to match that which Laravel is doing.
Was this feature implemented?
I'm in a position where knowing the name of the rule that failed is vital.