Laravel elocuente Únete a dos modelos
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'
);