I have an application written in Laravel 5. I have a model Product
which uses a table products
.
In the table I want to store the product size. At the moment there are only two sizes: M
and L
which stand for Medium and Large.
An admin user is able to update the size so I will have a dropdown for this. My question is; what is the best way to store the size data?
- Add static array the Product Model
- Create a Size Model with database with a relationship
- Create a Size Model with no database but a static array
- Add the array to config file
It is possible that more sizes will be introduced and that other models will use them. I'm thinking it's fine to just add as a static array to the Product model.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire