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
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

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
@amaelftah
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants