I'm totally confused.
Laravel structure is MVC, but recently I heard that sometimes developers use DDD in laravel.
I tried to find some Laravel projects used DDD but didn't get any results
Sometimes the application is in its early stages and going for microservice architecture isn't the best choice but we might need to scale the project sooner or later. In these scenarios personally, I prefer DDD. So with a good implementation of DDD, we can separate different business logic in a monolith application until the need for scaling.
I once used DDD in a laravel application. I created a Domain
folder inside the app
folder. For every domain that I had, I created a folder with a mini-laravel app inside them(including controllers, configs, routes, services, etc.) So I had a project that was ready to split into smaller services in case of scaling.
The tricky part was implementing the infrastructure. We usually have a lot of shared codes between these domains(e.g. events, notifications, etc.) so I needed to write all of these codes in Infrastructure
folder and use them like some packages, and again in case of scaling, I copied the whole folder into the new service.
Also other than the need for scaling, sometimes we have a big monolith application with +100 controllers. Handling them in standard laravel architecture will be a disaster. In those cases going for DDD might be a good idea for better maintainability.