When making a simple application with Laravel, its given folder structure is good enough without any changes. That is, controllers with controllers, models with models and views with views. But if you see your project growing into something that will be difficult to navigate with given folder structure, then mostly it is recommended to go Modular or DDD (Domain Driven Development). However, in my opinion, both of these approaches are still applied to "big" projects.
But what if your project is neither small nor big? It's just right there, where you kind of want to refactor to one of the mentioned approaches, but you know that doing so might not be the best solution and keeping it as it is, is also creating a bit of hassle to navigate through your code. I know that feeling, I have been there a few times.
What I found the best approach was to refactor a little with no major changes to the default structure. That is to group module specific classes within the controllers, models and views. Let me explain a bit more. For example, I have to implement a grant feature in my current project. Which allows users to open grants and members can submit proposals for the grants, then users can process the proposal requests and award members accordingly and track reports submitted by members for the awarded grant. So there are few models involved in the feature, like: Grant Type, Grant. Grant Proposal, Grant Awards, Reports, etc.
The project has lots of other features and putting everything in models, views and controllers without refactoring makes navigation a lot time-consuming. However, as said, I do not want to go full modular or DDD either. I just want something in between. So I just created a Grants folder in Models and moved everything there. Any model that is related to this feature is going into the â€œApp\Models\Grantsâ€ folder. Likewise, any controller related to grants is going to the â€œApp\Http\Controller\Admin\Grantsâ€ folder and any view that is related to the grant feature is going to the â€œresources/views/admin/grantsâ€ folder.
This way it is still using the default structure (almost), however just this small refactor into a separate folder gives much better readability and accessibility.