1$assignment_details = $assignment->raw_plan()
2 ->select('raw_plans.*', DB::raw('group_concat(name) as names'))
3 ->where('assignment_id', 1)
4 ->groupBy('flag')
5 ->get();