Form Validation

I’m curious to know where form validation should be done? In the controller is what i have seen in many cases. But, would it be better to move it into the middleware and run per route as needed? Or is it better in another location altogether?

Thanks

Hello,
I have them at the service level before processing the data, all in a folder called Validation, which has functions depending on the service and I use Respect\Validation for them.

Middleware - categorically and indisputably :smiley:

@tj_gumis I thought that might be the case.

@goldrak I’m trying to learn OOP and move away from procedural. In a previous life thats all i knew.

I’m getting better, but I don’t spend enough time at it. I work entirely too much, so keeping up and wrapping my head around new things is slow going.

Thanks for your responses.