Laravel whereHas 怎样嵌套加载查询?
whereHas 支持像 with 那样的嵌套吗?
比如 $user->post->comment
,当条件位于 comment 的时候,查询语句
User::whereHas('post.comment',function($query){
$query->where('is_good',1);
});
这样会报错,一般处理这种情况是怎样的?
推荐文章: