'ecology' => $ecology,
'crime' => $crime,
'social_protection' => $social_protection,
'economy' => $economy,
'count' => $count,
В примере запросы через класс фреймворка, но если знаете как через SQL запрос сделать, то напишите.
select (select SUM(ecology)) as `ecology`, (select SUM(social_protection)) as `social_protection` from `ratings` where `point` = ?
\DB::table('ratings')
->selectRaw('sum(crime), sum(ecology)')
->where('point', 'test')
->get();
select sum(crime), sum(ecology) from `ratings` where `point` = ?