laravel db query join with one to many code example
Example: laravel + join 2 eloquent queries
$select->joinSub(
$selectSubQry,
'ag',
'ag.id',
'=',
'agp.userId'
);