【发布时间】:2019-09-30 11:15:56
【问题描述】:
有 3 种型号:
First (first_id)
Connection (connection_id, first_id, product_id)
Second (second_id, product_id)
我想使用 laravel 关系将三个模型连接在一起
First->通过first_id加入连接
Connection->通过first_id加入First,并通过product_id加入Second
Second -> 通过product_id 加入连接
所以:首先通过连接first_id、product_id 加入第二个
这可以使用HasManyThrough 之类的东西吗?
感谢您的宝贵时间
【问题讨论】:
标签: php laravel laravel-5 eloquent eloquent-relationship