Repository navigation
Conversation
- Fix optional field validation to properly handle null, empty string, and empty array - Add explicit boolean value conversion to string for validation - Improve missing value detection with strict type checking
- Implement validateWildcardPath() method for complex nested validation - Add support for multiple wildcard levels (field.*.subfield.*) - Enhance getValue/setValue methods with improved dot notation support - Add recursive wildcard handling for deeply nested structures - Improve error reporting with accurate field paths for wildcards - Maintain backward compatibility with existing validation patterns - Added tests
|
Thanks for this. No CI has run on the PR, and the suite doesn't start locally on PHP 8.4 because of the old Pest version in the lockfile, so I can't confirm the new tests pass. The change also touches how wildcard and nested fields validate and adds a return type to addError, which can affect existing apps. Holding this for Michael to review. |
|
Thanks for this, @debba. The wildcard work looks good. One request before we can merge: could you split the falsy-value change out into a separate PR? Currently |
|
Thanks for taking a look! I’ll keep the wildcard changes and helpers in this PR, restore the current Then I’ll open a separate PR from Does that sound like the split you had in mind? |
|
Yes that's perfect 👌🏽 |
|
Thanks @debba, CI is green now and addError keeps its old signature. The falsy-value change is still in this PR though: the optional check and the missing-value check in Form.php now treat 0, "0" and false as present. Could you restore the previous behaviour here and move that change to its own PR as agreed? The @Version bump to 3.1.0 can wait for release as well. |
|
Thanks for checking! I’ll take out the version bump and leave it for the release. I had another look at the falsy checks. They already landed in Did you want me to revert the behavior from #14 as well, or is it okay to keep what’s already in |
What kind of change does this PR introduce? (pls check at least one)
Description
Enhanced the Form validation system with a wildcard support for complex nested array structures. This enables validation of dynamic data like orders with variable products, user lists with different attributes, and other nested collections.
Real-world Use Cases
Summary