Answer the question
In order to leave comments, you need to log in
Validating Request $request?
It is necessary to validate in different methods in different ways, and not to be indicated in the annotations, there are already too many of them.
Do something in the style of Laravel
https://laravel.com/docs/5.5/validation#creating-f...
It will also be necessary to add a bunch of rules, because apparently Symfony finally doesn’t care how validation and authorization are done there , let others sculpt everything themselves from scratch, or bundles and packages.
That is, to accept not a Request, but an already checked DoSmthRequest.
public function registerNewUser(CreqteNewUserRequest $request)
'some_field_goes_here' => new Rulle(), new Rulle(), new Rulle(), new Rulle(), new Rulle(), new Rulle(), new Rulle(), new Rulle(), new Rulle(), new Rulle(),
looks bad, right? Answer the question
In order to leave comments, you need to log in
Request is an HTTP request wrapper. An HTTP request may not be valid if it is incorrectly composed: incorrect header value, etc., it has nothing to do with business logic (the email is not correctly specified in the form, etc.). In my opinion, what is done in Laravel (if this is true, I emphasize that I do not know it!) Is madness.
I recommend looking at the validation groups, maybe this is what you need: How to Apply only a Subset of all Your Validation ... .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question