Jak przekazać parametry do relacji Laravel
$users = User::with(['posts' => function($query)
{
$query->where('title', 'like', '%first%');
}])->get();
Kriss Sachintha
$users = User::with(['posts' => function($query)
{
$query->where('title', 'like', '%first%');
}])->get();