headers->set('Authorization', 'Bearer '.$token); } public function export(Request $request) { $startDate = $request->query('start_date'); $endDate = $request->query('end_date'); $exportsPendingArrangementDeliveryList = new ExportsArrivedParcel($startDate, $endDate); $response = $exportsPendingArrangementDeliveryList->download('arrived-parcel.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function summary(Request $request) { $exportsParcelsSummary = new ExportsParcel(); $response = $exportsParcelsSummary->download('parcel-summary.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function guangZhou2ToJohor(Request $request) { $exportsWarehousePackingList = new ExportsWarehousePackingList(); $response = $exportsWarehousePackingList->download('guangzhou2-to-johor-summary.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function aging(Request $request) { $data = new ExportsAgingList(); $response = $data->download('aging_report.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } }