mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Safely clean output buffer only if it's started and not already cleaned
This commit is contained in:
@@ -60,14 +60,20 @@ class ExportCustomersToExcelController
|
||||
}
|
||||
}
|
||||
|
||||
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']);
|
||||
// Safely clean output buffer if it exists
|
||||
if (ob_get_level()) {
|
||||
public function groupTransaction(Request $request)
|
||||
{
|
||||
// Safely clean output buffer only if it's started and not already cleaned
|
||||
while (ob_get_level() > 0) {
|
||||
ob_end_clean();
|
||||
}
|
||||
return $response;
|
||||
|
||||
$exportsTransactions = new ExportsGroupTransactions($request);
|
||||
|
||||
return $exportsTransactions->download(
|
||||
'group-transactions.xls',
|
||||
\Maatwebsite\Excel\Excel::XLS,
|
||||
['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
|
||||
);
|
||||
}
|
||||
|
||||
public function totalOrders(Request $request){
|
||||
|
||||
Reference in New Issue
Block a user