I have a Project model. Each Project can have a thumbnail, main image and other multiple assets / images (project details for example) and also multiple text contents (that would be placed in between these images). And each Project page will pull in these assets (except the thumbnail) and texts, and display them in a specific order (that I define by drag and drop on my control panel).
So basically the similar structure to what Behance uses for example. I'm trying to structure this using Eloquent and here is what I was thinking of doing:
I can have let's say Asset and Text models with hasMany() relationship on Project model. These two models would have a column called pageSort and then the controller would merge these two collections together and sort them using that pageSort column.
Any other suggestions?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire