Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

count with left join in laravel

$areas = Area::select('areas.*', DB::raw('count(area_id) as connections'))
	->leftJoin('object_areas', 'object_areas.area_id', '=', 'areas.id')
	->groupBy('areas.id')gg
	->get();
Source by github.com #
 
PREVIOUS NEXT
Tagged: #count #left #join #laravel
ADD COMMENT
Topic
Name
2+3 =