有3种型号:
First (first_id)
Connection (connection_id, first_id, product_id)
Second (second_id, product_id)
我想使用 laravel 关系将三个模型连接在一起
First
->虽然加入了连接first_id
Connection
-> 加入了 First through first_id
, & 加入了Second
通过product_id
Second
-> 加入了 Connection throughproduct_id
所以:首先通过 Connection 加入到 Second first_id
,product_id
这可以使用类似的东西HasManyThrough
吗?
谢谢你的时间