Cvetan's avatar

Class to modify input before sending to model

What would be good place to modify input in some way before sending to model, or validaton? And not to flood controller with that code?

For instance if i need some file upload. I need to check if file uploaded successfully, return path, and append to object data to save to database. Is there common practice for this kind of job?

0 likes
3 replies
Snapey's avatar
Snapey
Best Answer
Level 122

Anything coming from a form I deal with in Form Request.

I certainly would not do it in middleware.

Please or to participate in this conversation.