MartinZeltin
2 months ago
382
3
General

Is it a good idea to put Models in different directories?

Posted 2 months ago by MartinZeltin

Is it a good idea to put Models in different directories according to feature?

For example if I'm building an app for a restaurant and I have features like Orders, Inventory, Statistics, Reports, Products.

Then would it make sense to have a structure like this?

app/
├── orders/
│   ├── Order.php <--- Model
│   ├── Payment.php
│   ├── Validation.php
├── products/
│   ├── Product.php <---- Model
│   └── Category.php <--- Model
└── reports/
    ├── Reports.php
    └── Generator.php

Would organizing the app by feature like so make sense?

Please sign in or create an account to participate in this conversation.