From 5634a996435cb79059608fbdc8bac19ab6576762 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 2 Mar 2022 04:02:28 +0800 Subject: [PATCH] download billing documents --- .../ControllersLogic/DownloadBookingDocumentLogic.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index bc1d9eb5..51ef3428 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -51,17 +51,10 @@ class DownloadBookingDocumentLogic exit("Error creating ZIP file"); }; - if (file_exists($attachment)) { + Storage::download('documents/collections/' . $zip_file); - header('Content-Type: application/zip'); - header('Content-disposition: attachment; filename='.$request->input('type').'.zip'); - header('Content-Length: ' . filesize($attachment)); - readfile($attachment); - } else { - exit("Could not find Zip file to download"); - } + File::delete($attachment); - unlink($attachment); } }