Hi All,
I am working on my most complex project to date, which is probably not that complex to some of you. I am going to try and simplify it for this question.
I have 3 tables with models, and 2 pivot table.
table1 (Model)
id, column_a, column_b, created_at, updated_at
table2 (Model)
id, column_a, column_b, column_c
table3 (Model)
id, column_a
table1_table2 (Pivot)
table1_id, table2_id, table3_id, column_a, column_b, column_c...
table1_table3 (Pivot)
table1_id, table3_id, column_a, column_b, column_c...
What I am struggling with, is defining the relationship of table2 hasOne table3. Is there anyway to do this?
There is a reason behind why my tables are laid out this way, if it will help solve the problem I can explain it, I just didn't want to clog up this post.
I apologies if this has been asked before; I tried reading through a large amount of pivot table relationship issues, but couldn't find this situation being discussed.
Thanks in advance,
Chris