【发布时间】:2019-03-20 04:08:36
【问题描述】:
我有 2 个表:产品和类别。我是否应该像这样在 Nova Resource 中声明急切负载:
// For Product Resource
/**
* The relationships that should be eager loaded on index queries.
*
* @var array
*/
public static $with = ['categories'];
或在这样的模型上:
// For model App\Product
protected $with = ['categories'];
如果我在资源和模型上都做。会不会造成重复查询?
【问题讨论】:
标签: laravel laravel-nova