successResponse( InfoItem::query() ->select('item as id', 'item_str as name', 'icon') ->where('type', '=', 'item') ->groupby('item') ->get() ); } public function getSubItems($item): JsonResponse { return $this->successResponse( InfoItem::query() ->where('item', '=', $item) ->select('id', 'item', 'item_str', 'sub_item_str as name', 'sub_item_unit as unit', 'needs_image', 'needs_end_point', 'sub_item') ->get() ); } }