📜  如何将参数传递给关系 laravel - PHP 代码示例

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

代码示例1
$users = User::with(['posts' => function($query)
{
    $query->where('title', 'like', '%first%');

}])->get();