Background:
Input validation is a critical piece of any framework. To avoid reinventing the wheel, we can leverage existing validators like Axe Validator and Simple Body Validator. The idea is to use both as they are the closest thing to Illuminate/Validation:
- Axe Validator for its expressive rules.
- Simple Body Validator as fallback or extension when one lacks rules the other provides.
This will create a flexible validation layer that ensures broad coverage of validation rules and extensibility.
Scope:
- Validation will be its own package:
@h3ravel/validation.
- The first consumer of this package will be
@h3ravel/http (for request validation).
Tasks:
Acceptance criteria:
- Developers can use
await request.validate(rules) inside controllers.
- Rules not available in one validator should fallback to the other.
- Validation errors have a consistent format across the framework.
- Tests demonstrate both validators working via the unified API.
Difficulty: medium–large
Background:
Input validation is a critical piece of any framework. To avoid reinventing the wheel, we can leverage existing validators like Axe Validator and Simple Body Validator. The idea is to use both as they are the closest thing to Illuminate/Validation:
This will create a flexible validation layer that ensures broad coverage of validation rules and extensibility.
Scope:
@h3ravel/validation.@h3ravel/http(for request validation).Tasks:
@h3ravel/validationat framework/packages.Validator.make(data, rules).passes()etc.).@h3ravel/httprequest lifecycle (Request.validate(rules)helper).@h3ravel/http.Acceptance criteria:
await request.validate(rules)inside controllers.Difficulty: medium–large