Validation: stopOnFirstFailure
should also stop after
callbacks
#39788
Unanswered
joelclermont
asked this question in
Ideas
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
If we set
$stopOnFirstFailure = true
, the intention is that all validation logic should stop once we encounter our first failure. I've noticed thatafter
callbacks continue to run, however.My desired behavior would be that
stopOnFirstFailure
would also prevent furtherafter
callbacks from running, whether it's something inrules
that failed, or something in anotherafter
callback that failed.Would there be support for this change? I'd be willing to submit a PR. I'm not sure if would be considered a breaking change or not either.
As a workaround, I have been adding a check for
$validator->failed()
inside myafter
callbacks.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions