Are you looking for a slick way for validating your incoming requests on your PHP web application? Then you are at the right place, because I will try to break this down and explain how the Laravel’s Request Validation works under the hood.
Let’s see how can we improve this, and explain the $this->container->call() method that is used to get the rules to validate the request.
If we check the FormRequest we are going to notice that it actually implements the ValidatesWhenResolved interface, and if we try to find the validateResolved method on the FormRequest, we are going to find the implementation for this inside the trait Illuminate\Validation\ValidatesWhenResolvedTrait that is also being used in the FormRequest
Please keep in mind that this is not the only method to validate request in Laravel.