May 12, 2016
0
Level 4
Get BelongsToMany and BelongsTo
If I have three tables A, B and C.
B and C have ManyToMany relationships, so there is a pivot table B_C.
Each record of B belongs to one record of A.
I can get B records associated with C from C Model by using belongsToMany relationship.
And I can get A record associated with B from B Model by using belongsTo relationship.
My question is how can I get B records with their associated A records from C Model?
Please or to participate in this conversation.