php - Laravel selectRaw with joined table data - Stack Overflow
https://stackoverflow.com/questions/40964201/laravel-selectraw-with-joined-table-data
WEBYou've to join the table hive_types in your query so you can access the name : $hive_count = DB::table('hives') ->where('active','true') ->join('hive_types', 'hives.hive_type_id', '=', 'hive_types.id') ->groupBy('hive_type_id','hive_types.name') ->selectRaw('sum(total) as sum, hive_types.name as name') ->pluck('sum','name'); edited Mar 26, 2019 ...
DA: 80 PA: 12 MOZ Rank: 71