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

dgvai's avatar
Level 1

Which is better? Single Controller - Multiple Methods OR Multiple Controllers - Few Methods ?

I have a curious question, though not really important in a project factor. In my project, I use to create numerous methods in a single controller, like 15-20 methods in a single controller. I have seen some other person coding in multiple controllers and using a few numbers of methods in each one.

Which is efficient? Does even it has any effect in server run-time memory if I use all the methods in one controller?

0 likes
2 replies
Jaytee's avatar

I stick to REST conventions. so 7 methods in a controller at a max (or sometimes 8 if I reuse the store and update methods).

Having 15-20 methods in a Controller just means it's not easily manageable. You start turning it into a god class, and add on to it continuously.

It's so much nicer and exciting to work with a project that is well structured, as opposed to monolithic code.

Sometimes, I use single action controllers. It depends on the use case. I see some people have single action controllers for each REST verb now

Please or to participate in this conversation.