Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Randy_Johnson's avatar

Food for thought

Is a controller or model needed. Could MVC just be MV, or VC, or am I just a crazy person.

Also I always written all my store stuff in controller store, is the correct way to write a store function in the model and then pass request parameters from the validation into

E.g. User->store($validated)

Apologies if it's wrong syntax, but due to AI I haven't written a line of code in months 😳

Edit: also validation has it's own area now which I never use, I just write it at the head of the store function, but wouldn't this be better to just be a function in the model that is called. Or am I just a crazy person 🤪

0 likes
1 reply
jlrdw's avatar

VC is fine in some cases. If using query builder instead of eloquent for example.

In java many time I'd use VC, meaning servlet and view.

But usually in a larger app it's best to go full MVC. I know in laravel a lot of people do as you do and store in the controller. I as well, but for queries to retrieve data I use full MVC. I make use of query scopes also when needed.

I try to keep the controller lean. I'd rather have a fatter model.

Please or to participate in this conversation.