What's New With 3.3.0
2022-JAN-12
Nested Constraints
validateOrFail(
target = {
"owner": { "firstName": "John", "lastName": "Doe" }
},
constraints = {
"owner": {
"constraints": {
"firstName": { "required": true, "type": "string" },
"lastName": { "required": true, "type": "string" },
}
}
}
);validateOrFail(
target = {
"owner": { "firstName": "John" }
},
constraints = {
"owner": {
"constraints": {
"firstName": { "required": true, "type": "string" },
"lastName": { "required": true, "type": "string" },
}
}
}
);
// ValidationError -> {
field: "owner.lastName",
message: "The `lastName` field is required"
}Array and Struct Shorthand Syntax
Validator Aliases
Added
Fixed
Last updated
Was this helpful?