From d64cd0bfe4d5ea1aaa095af0bdbd617f2801ccb2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 2 Mar 2022 03:22:47 +0800 Subject: [PATCH] download billing documents --- .../ControllersLogic/DownloadBookingDocumentLogic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index 2886b897..9893a39b 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -49,8 +49,8 @@ class DownloadBookingDocumentLogic Auth::login(User::findOrFail(1)); $zip_file = $request->input('type').'.zip'; - $attachment = Storage::disk('documents')->path('collection/'.$zip_file); -dd(storage_path('collection/'.$zip_file)); + $attachment = storage_path('/documents/collections/'.$zip_file); + $zip = new ZipArchive(); if ($zip->open($attachment, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) { @@ -67,7 +67,7 @@ dd(storage_path('collection/'.$zip_file)); $zip->close(); - return Storage::download($attachment); + return Storage::download('/documents/collections/'.$zip_file); } }