1$areas = Area::select('areas.*', DB::raw('count(area_id) as connections'))
2 ->leftJoin('object_areas', 'object_areas.area_id', '=', 'areas.id')
3 ->groupBy('areas.id')
4 ->get();
1$areas = Area::select('areas.*', DB::raw('count(area_id) as connections'))
2 ->leftJoin('object_areas', 'object_areas.area_id', '=', 'areas.id')
3 ->groupBy('areas.id')
4 ->get();
1$areas = Area::select('areas.*', DB::raw('count(area_id) as connections'))
2 ->leftJoin('object_areas', 'object_areas.area_id', '=', 'areas.id')
3 ->groupBy('areas.id')gg
4 ->get();