From 9083dea144004a56191ac85ba6e07086e7a567fa Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 2 Mar 2022 04:23:40 +0800 Subject: [PATCH] download billing documents --- .../ControllersLogic/DownloadBookingDocumentLogic.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index 90df4f86..8d7dafde 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -23,7 +23,7 @@ class DownloadBookingDocumentLogic /** * @param Request $request - * @return void + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse * @throws MalformedRequestException */ public function execute(Request $request) @@ -48,10 +48,10 @@ class DownloadBookingDocumentLogic } $zip->close(); - - header('Content-Type: application/zip'); - header('Content-Length: ' . filesize($attachment)); - readfile($attachment); + return response()->download($attachment)->deleteFileAfterSend(true); +// header('Content-Type: application/zip'); +// header('Content-Length: ' . filesize($attachment)); +// readfile($attachment); // unlink($attachment); }