【发布时间】:2014-03-07 12:45:38
【问题描述】:
基本上是这样的
Section::with('fields')->find($id);
还有:
Section::with(['fields' => function ($q) {
$q->select('*');
}])->find($id);
然而:
Section::with(['fields' => function ($q) {
$q->select('label', 'position');
}])->find($id);
不会加载关系。
除了使用“where”之外,我还没有在文档中找到有关急切加载约束的内容,所以我的问题是,这是否可能?
提前致谢。
【问题讨论】: