Polymorphic Many-to-Many pivot table with relationship to another table
I have the following table structure as shown in the diagram:

Briefly, it is composed of several many-to-many polymorphic relationships as described:
-
many
resourcescan have manysourcesand the pivot tablesourceablescontainscatalog_numberandlot_numberinformation to make each row in the pivot table unique. Many resources could also come from the same source or from different sources, differentiated by the catalog number and lot number on the pivot table. -
many
resourcescan also have manypublicationsattached to it, through thepublicationablestable withnoteson the pivot table -
a resource's source could also be described in many publications.
My questions:
- Since the resource's source is differentiated by the pivot table
sourceableshow should I save the relationship between the pivot rows ofsourceablesto thepublications? - How to retrieve a resource with all it's publications and also with the sources with all corresponding publications?
Please or to participate in this conversation.