I would say if that structure works for you, then it's good.
As for question #2, adding items to the map method of RouteServiceProvider would get the job done.
Hint: app/Providers/RouteServiceProvider.php
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello! I hope you're all well!
I've been searching for quite a while on how to do a modular application in Laravel.
I've been seeing a ton of threads on L4, but none on L5 (perhaps L5 is too recent?)
Here is a directory structure I thought of:
/modules
/Rest
/Commands
/Console
/Events
/Exceptions
/Foundation
/Handlers
/Http
/Providers
/Services
/Support
/Frontend
[Same structure]
/Backend
[Same Structure]
/System
[Same Structure]
(Is that even a good structure to use?)
Front, Backend and Rest all need some classes from /System, as they all have access to the same data. AKA Frontend to read, Backend to write, and REST for both (for access in mobile applications or with Angular and such).
Each module has it's own routes.php file to designate routes for his module.
Here are my questions:
Thanks alot!
I would say if that structure works for you, then it's good.
As for question #2, adding items to the map method of RouteServiceProvider would get the job done.
Hint: app/Providers/RouteServiceProvider.php
Please or to participate in this conversation.