I have a question on Form Request validations and middlewares-
I'm wondering how can I make my requests go through my custom Form Request validation before entering my middleware stack.
Long story short... I have some API endpoints, some middlewares to perform some logic validation and a Form Request class in which I validate that the input parameters are syntactically correct using some regular expressions.
My problem is that I would like the request to first go through the Form Request validation and then (when I know that all parameter meet their syntax requirements) go through the middleware stack.
I know I could try to match the input parameters in the middleware and return an error but then I would have duplicated the validation logic and I don´t want that.
I have tried to type-hint the FormRequest class in the middleware´s handle method but then it gives me an error saying that I should pass a FormRequest instance and I passed a Request instance.
Any help would be really appreciated.
Thanks