Skip to content

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

Merged
taylorotwell merged 3 commits into
laravel:5.8from
tillkruss:after-validation-cb
Aug 14, 2019
Merged

[5.8] Add ValidatesWhenResolvedTrait::passedValidation() callback#29549
taylorotwell merged 3 commits into
laravel:5.8from
tillkruss:after-validation-cb

Conversation

@tillkruss

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