Laravel elokwent dołącz do dwóch modeli
Event::whereHas('participants', function ($query) {
return $query->where('IDUser', '=', 1);
})->get();
Cleo
Event::whereHas('participants', function ($query) {
return $query->where('IDUser', '=', 1);
})->get();
$select->joinSub(
$selectSubQry,
'ag',
'ag.id',
'=',
'agp.userId'
);