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

[5.8] Add ValidatesWhenResolvedTrait::passedValidation() callback #29549

Merged
merged 3 commits into from Aug 14, 2019

Conversation

@tillkruss
Copy link
Member

commented Aug 13, 2019

Similar to the prepareForValidation() callback, it would be quite handy to have a afterValidation() callback as well.

This would allow us to apply filters to request values, such as converting types without interfering with Laravel validation.

@tillkruss tillkruss changed the title Add ValidatesWhenResolvedTrait::afterValidation() callback [5.8] Add ValidatesWhenResolvedTrait::afterValidation() callback Aug 13, 2019

@garygreen

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

It's not obvious if afterValidation fires when validation passed or failed.

I would suggest keeping the same convention as failedValidation by having the method called passedValidation instead.

@tillkruss

This comment has been minimized.

Copy link
Member Author

commented Aug 13, 2019

Great suggestion!

@tillkruss tillkruss changed the title [5.8] Add ValidatesWhenResolvedTrait::afterValidation() callback [5.8] Add ValidatesWhenResolvedTrait::passedValidation() callback Aug 14, 2019

@taylorotwell taylorotwell merged commit 8431652 into laravel:5.8 Aug 14, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/styleci/pr The analysis has passed
Details
@Te7a-Houdini

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

glad this is merged 😄 . i tried it once in this PR but didn't have luck 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.