laravel + join 2 eloquent queries
snippet in php

laravel + join 2 eloquent queries

user8658

 $select->joinSub(
                    $selectSubQry,
                    'ag',
                    'ag.id',
                    '=',
                    'agp.userId'
                );