【发布时间】:2020-08-01 17:35:02
【问题描述】:
我有 3 层深表:
1.plan -> 2.steps -> 3.nomenclature
而且我不需要具有 2 个不同嵌套表的加载对象命名法
3.1 - uom (1:1)
3.2. - ingredients (1 to many)
我现在使用 hasManyThrough 来接收命名对象。我可以为这个对象添加 3.1 uom:
$plan = Plan::with(['steps', 'items.nomenclature.uom'])
但我怎样才能添加 3.1 uom 和 3.2。成分同时到命名对象?
【问题讨论】:
标签: laravel eloquent nested relationship