headers->set('Authorization', 'Bearer '.$token); return $exportsCustomers->download('customer-latest-order-date.csv', Excel::CSV, ['Content-Type' => 'text/csv']); } public function nullDebtor(ExportsNullDebtors $exportsNullDebtors, Request $request){ $response = $exportsNullDebtors->download('nullDebtor.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function paymentTransactions(Request $request){ $exportsTransactions = new ExportsPaymentTransactions($request); $response = $exportsTransactions->download('payment-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function groupTransaction(Request $request){ $exportsTransactions = new ExportsGroupTransactions($request); $response = $exportsTransactions->download('group-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } public function totalOrders(Request $request){ $exportsTotalOrders = new ExportsCustomerTotalOrderByYear($request); $response = $exportsTotalOrders->download('total-orders-' . $request->route('year') . '.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']); ob_end_clean(); return $response; } }