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

sulaimanMisri's avatar

How would you structuring your Controller?

Hello guys. I would like to know, how you structure your Controller when it comes to large applications.

Here we've got 5 features in the system with 4 roles.

Features.

  1. School Management System (For admin tasks).
  2. Learning Management System.
  3. E-commerce.
  4. Forum.
  5. Blog.

Roles.

  1. Admin.
  2. Teacher.
  3. Parents.
  4. Student.

Each of the roles has access to all features. So how would you structure the Controller? Is it creating the controller and bundling up in the app/Http/Controllers folder or what?

I know this question is more likely depends on the person. But want to know. I know I can learn something from here :)

0 likes
5 replies
sulaimanMisri's avatar

@tisuchi

Very true. I'm implementing the DDD structure. But just want to learn how other devs will structure the Controller :)

tisuchi's avatar

@sulaimanMisri It's always hard to maintain such a structure by other developers.

My opinion is to maintain a project README.md file updated and force team members to follow this strictly (in terms of structure). So that other developers can easily extend/modify the project with proper structure.

putera's avatar

You can put where ever you want actually. Also you can put in your Controllers folders by categories them by features.

I think you need to learn Domain Driven for large scale system like this. I would prefer Domain Driven for Laravel by Jesse Griffin.

2 likes
sulaimanMisri's avatar

@putera Very true. No best answer for this. Because it depends on the individual or team.

I'm implementing the DDD structrure. Just want to learn how other devs going to structure if they've requirements like this :)

Thanks for the suggestion though!

Please or to participate in this conversation.