I am trying to build a simple billing and invoicing system with Laravel, and intend to create an API for further development. I would like to find out how it is better to structure and house the controllers so that it will be neat and clean.
Which is a better option to go about for structuring and housing the API controller with normal UI controller within the same project?
1) Have them structured like:
/controllers
|-- /API
|-- InvoiceController.php
|-- UserController.php
|-- /UI
|-- InvoiceController.php
|-- UserController.php
2) Modular structure like:
/controllers
|-- /API
|-- InvoiceController.php
|-- UserController.php
/modules (for normal UI controllers, etc)
|-- /invoices
|-- InvoiceController.php
|-- /users
|-- UserController.php
3) All in one structure like:
/controllers
|-- InvoiceController.php
|-- UserController.php
|-- InvoiceControllerAPI.php
|-- UserControllerAPI.php
Hopefully someone will be able to help me with the answers, or provide me with some advices and suggestions. Thanks.