vlucas/valitron
Valitron is a lightweight, dependency-free PHP validation library with simple, readable rules. Validate arrays like $_POST in one call, get structured errors, and extend with custom rules and callbacks—minimal code, well tested, and framework-agnostic.
Thank to all contributors!
Allow disabling of auto prepending the field labels
Add support for SL language
New rules requiredWith and requiredWithout for conditional requirements
new rule listContains - Performs in_array check on given array values
New rule arrayHasKeys
Fixed a bug[#262] where array elements where considered required when any rule was applied to them New rules for dealing with arrays: subset and containsUnique Languages: new string in Lithuanian, Norwegian Bokmål added Additional documentation and comments
New languages: Lithuanian, Swedish, Korean New option to stop validating when the first error is encountered Support for nested arrays for 'equals' and 'different' rules Enhanced tests
The validateRequired method required $fields to be an array, and this broke compatibility with objects that implement PHP's ArrayAccess interface.
Please note that while ArrayAccess-objects will probably work most of the time, Valitron is meant to be used with actual arrays.
Validator::mapFieldRules() provides another way of adding rules on a per-field basis
Added a flag to validateInteger() to enable strict checking (bypassing PHP's automatic conversions)
Massive thanks to @wenbinye for spotting the bug, and sorry for any inconvenience it may have caused
General:
Languages:
Rules:
Thanks to @willemwollebrants for his work on issues and PRs to get this release out.
Updated:
New functionality:
New languages:
Updated language:
How can I help you explore Laravel packages today?