From 5c8a821d265cd217286d244090f9b44d8caebf27 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 2 Mar 2022 03:27:10 +0800 Subject: [PATCH] download billing documents --- .../ControllersLogic/DownloadBookingDocumentLogic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index 9893a39b..f2c15727 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 = 'documents/collections'.$zip_file; $zip = new ZipArchive(); if ($zip->open($attachment, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) { @@ -67,7 +67,8 @@ class DownloadBookingDocumentLogic $zip->close(); - return Storage::download('/documents/collections/'.$zip_file); + dd(Storage::disk('documents')->exists($attachment)); + return Storage::download($attachment); } }