From 7b35c7ca895349d85d946ecf0471b3fc65e2243f Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sun, 26 May 2024 20:04:46 +0800 Subject: [PATCH] Laravel Vapor - sync code for download files in bulk from S3 --- .../ControllersLogic/DownloadBookingDocumentLogic.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index fde8c118..ddced571 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -31,19 +31,17 @@ class DownloadBookingDocumentLogic Auth::login(User::findOrFail(1)); $document_type = str_replace(' ', '', $request->input('type')); - $zipDirectory = storage_path('/app/documents/collections'); + $zipDirectory = storage_path('app/documents/collections'); if (!file_exists($zipDirectory)) { mkdir($zipDirectory, 0755, true); } $zip_file = $document_type.'.zip'; - - $attachment = storage_path().'/app/documents/collections/' . $zip_file; - Log::info('attachment 1: '. $attachment); - + // $attachment = storage_path().'/app/documents/collections/' . $zip_file; + // Log::info('attachment 1: '. $attachment); $attachment = "{$zipDirectory}/{$zip_file}"; - Log::info('attachment 2: '. $attachment); + Log::info('attachment: '. $attachment); $bookings = Booking::where('status', ApprovalStatus::COMPLETED) ->whereDate('created_at', '>=', Carbon::parse($request->input('startDate')))