Forms: rules() to accept a closure #1911
titantwentyone
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
We do support closures, you can pass an array of closures and each closure returns a dynamic rule. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Just come across a use case where my options for a select are dynamically generated based upon the input of another field. In this instance, my validation would change.
Currently,
rules()
only accepts a string or an array. Would be great if this could accept a closure also to enable dynamic validation like this.Again, adding here for a reminder. Happy to generate a PR if no objections found. Should be pretty straightforward I believe?
Beta Was this translation helpful? Give feedback.
All reactions