Repository navigation
v2.0.0
Major Changes
- Complete architecture redesign for better flexibility and maintainability
- New validation system now supports batch validation of multiple fields and rules
- Added support for custom validation rules via
addCustomRule()method - Improved error handling with multiple errors per field
New Features
-
Batch Validation
- New
validate()method now accepts array of data and rules - Support for multiple validation rules using pipe syntax (e.g., 'required|email|min:8')
- Parameter support in validation rules (e.g., 'min:8')
- New
-
Custom Rules
- New
addCustomRule()method for extending validation capabilities - Custom rules can access full data context during validation
- New
-
Enhanced Error Handling
- Multiple error messages per field (array-based storage)
- Flexible message customization with field-specific overrides
- Hierarchical message resolution (field.rule > rule > default)
-
New Methods
passed(): Check if validation passedfails(): Check if validation failederrors(): Get all validation errors
Breaking Changes
- Complete API overhaul - not backward compatible with 1.x
- Changed validation method signature
- New error storage structure (array-based instead of single message)
- Removed
ValidationMessagesclass in favor of direct message array handling
Technical Improvements
- Strict typing enabled with
declare(strict_types=1) - Better separation of concerns
- More flexible rule parameter handling
- Improved message templating system