Answer the question
In order to leave comments, you need to log in
Is it correct to place the validation logic in the Request class?
The essence of the question is in the title. In numerous examples for Laravel, as a best practice, it is recommended to place the request validation logic in the Request class. Doesn't this violate the Single Responsibility Principle, especially if this logic goes beyond the usual checking of parameters matching some regular expression?
Answer the question
In order to leave comments, you need to log in
Well, yes, not according to SOLID code :) If you are talking about this
https://github.com/laravel/framework/blob/7.x/src/...
A couple of principles are strongly violated:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question