📌  相关文章
📜  不获取与父 laravel eloquent 相关的所有数据 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:50.930000             🧑  作者: Mango

代码示例1
$runs = Run::whereHas('times', function ($builder) use ($user) { 
        $query->where('user_id', $user->id);
    })->with(['times' => function ($query) use ($user) {
        $query->where('user_id', $user->id);
    }])->get();