父约束中对子孙嵌套约束的渴望负载

时间:2018-08-06 15:46:31

标签: php laravel

$products = Product::with
 (['option', 'option.optionValue' => function($query) use (PARENT) {
     $query->wherePivot('product_id', '=', PARENT->pivot->product_id);
 }])->get();

如何传递PARENT约束在孙约束中动态地枢转列值。有可能。

0 个答案:

没有答案
相关问题