I have a Collections table, a Components table, and a pivot table for a many-to-many relationship between Collections and Components. This lets me create 'Collections' of 'components'. Im using rutorika-sortable to enable sorting of the components.
The issue is that I also want the possibility for a Collection to be related to another Collection. I tried a 'Collection-Collection' pivot table, and the problem I ran into was I could no longer figure out how to deal with sorting. For example, I want Component A, Collection B and Component B to belong to Collection A and be displayed in that order when viewing Collection A. Sorting no longer works because the order columns in the two pivots are independent of each other.
Im thinking I need some sort of polymorhpic relationship, but im not sure what the best way to go about this would be. How can I achieve the results I want?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Jwt0XZ
via IFTTT
Aucun commentaire:
Enregistrer un commentaire