我有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'];
如果我在资源和模型上都做。会导致重复查询吗?
答案 0 :(得分:0)
您可以使用barryvdh / laravel-debugbar,您将找到所需的所有答案。