From 8c2f601ea2a3575aed1ecc831a0d7229f77faa08 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 2 Mar 2022 03:34:35 +0800 Subject: [PATCH] download billing documents --- .../ControllersLogic/DownloadBookingDocumentLogic.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index 2eba08af..98dfef04 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -49,7 +49,7 @@ class DownloadBookingDocumentLogic Auth::login(User::findOrFail(1)); $zip_file = $request->input('type').'.zip'; - $attachment = storage_path().'/documents/collections'.$zip_file; + $attachment = storage_path() . '/' . $zip_file; $zip = new ZipArchive(); if ($zip->open($attachment, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) { @@ -66,9 +66,11 @@ class DownloadBookingDocumentLogic } $zip->close(); - - dd(Storage::exists($attachment)); +dd(File::exists($attachment)); return Storage::download($attachment); + File::delete($attachment); + + exit; } }