Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to stop validation after a failure (similar to Laravel bail) #33

Closed
justin-schroeder opened this issue Mar 11, 2020 · 0 comments · Fixed by #85
Closed

Option to stop validation after a failure (similar to Laravel bail) #33

justin-schroeder opened this issue Mar 11, 2020 · 0 comments · Fixed by #85
Labels
future Accepted and tracking for an upcoming release
Milestone

Comments

@justin-schroeder
Copy link
Member

Similar to something like Laravel's bail. There are a few ways we could go about implementing it from a syntax standpoint. Laravel has chosen (and we've largely mirrored) to use rules, or almost pseudo-rules to allow modification of the validation "runtime" examples: bail and sometimes

required|bail|between:0,100

This keeps the syntax all familiar – although I've always found these "modifiers" a little opaque to read. Are they sequential? global (they are global), etc.

I think we could keep this mirroring, but I wonder if there's any appetite for a modifier on a rule. Possible syntax:

validation="^required|between:0,100"

In this case, the rest of the validation rules would run only if required passes, but if it does the rest of the rules would run even if one of them fails (not just first failure like bail).

@justin-schroeder justin-schroeder created this issue from a note in Roadmap (2.3.0) Mar 11, 2020
@justin-schroeder justin-schroeder added the feature request New feature or request label Mar 11, 2020
@justin-schroeder justin-schroeder added this to the 2.3.0 milestone Mar 16, 2020
@justin-schroeder justin-schroeder added future Accepted and tracking for an upcoming release and removed feature request New feature or request labels Mar 26, 2020
@justin-schroeder justin-schroeder linked a pull request May 16, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future Accepted and tracking for an upcoming release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant