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

crestheaven's avatar

Laravel 5 App Structure for large applications

I am working on a fairly large Laravel application and wanted to get some input on the ideal namespace/directory structure, or at least a general sense of the advantages and disadvantages of different approaches.

I have been toying with two since the announcement of Laravel 4.3:

A) Pros/cons of organizing your app in terms of features? (Acme\Users) Which would have Acme\Users\Commands, Acme\Users\Repositories\, Acme\Users\Events, etc.

B) Or is it better to organize in terms of function? Acme\Commands\Users, Acme\Repositories\Users, Acme\Events\Users, etc.

Also, with option A, let's say you had a one to one relationship with a contact table. Would you group Contact model within the Acme\Users namespace or should it be divided up by resource, e.g. Acme\Contacts instead?

Thanks in advance.

0 likes
3 replies
rhyslbw's avatar

Also keen for this topic to be revisited with Laravel 5's default structure in mind

Please or to participate in this conversation.