get(); return response()->json([ 'allSubDistrict' => $allSubDistrict, ]); } public function excelParameterHeightSubDistrict($year) { $parameterHeightSubDistrict = HeightSubDistrict::select('height_sub_district.id as height_id', 'height_sub_district.height', 'height_sub_district.year', 'sub_district.id as sub_district_id', 'sub_district.sub_district') ->join('sub_district', 'height_sub_district.sub_district_id', '=', 'sub_district.id') ->where('height_sub_district.year', $year) ->get(); return Excel::download(new ParameterHeightSubDistrictExport($parameterHeightSubDistrict), 'parameter-ketinggian-kecamatan-tahun-' . $year . '.xlsx'); } }