count(); $total_tata_ruang_non_usaha = SpatialPlanning::where('building_function','not like', '%usaha%')->count(); $data_report_tourism = TourismBasedKBLI::all(); $data_pajak_reklame = Tax::where('tax_code','Reklame')->count(); $data_pajak_restoran = Tax::where('tax_code','Restoran')->count(); $data_pajak_hiburan = Tax::where('tax_code','Hiburan')->count(); $data_pajak_hotel = Tax::where('tax_code','Hotel')->count(); $data_pajak_parkir = Tax::where('tax_code','Parkir')->count(); return response()->json([ 'total_reklame' => $total_reklame, 'total_pdam' => $total_pdam, 'total_tata_ruang' => $total_tata_ruang, 'total_tata_ruang_usaha' => $total_tata_ruang_usaha, 'total_tata_ruang_non_usaha' => $total_tata_ruang_non_usaha, 'data_report' => $data_report_tourism, 'data_pajak_reklame' => $data_pajak_reklame, 'data_pajak_restoran' => $data_pajak_restoran, 'data_pajak_hiburan' => $data_pajak_hiburan, 'data_pajak_hotel' => $data_pajak_hotel, 'data_pajak_parkir' => $data_pajak_parkir, ], 200); }catch(\Exception $e){ return response()->json([ 'message' => 'Error: '.$e->getMessage() ], 500); } } }