mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 14:33:59 +00:00
Laravel Vapor - sync code for download files in bulk from S3
This commit is contained in:
@@ -30,8 +30,20 @@ class DownloadBookingDocumentLogic
|
||||
{
|
||||
Auth::login(User::findOrFail(1));
|
||||
$document_type = str_replace(' ', '', $request->input('type'));
|
||||
|
||||
$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 = "{$zipDirectory}/{$zip_file}";
|
||||
Log::info('attachment 2: '. $attachment);
|
||||
|
||||
$bookings = Booking::where('status', ApprovalStatus::COMPLETED)
|
||||
->whereDate('created_at', '>=', Carbon::parse($request->input('startDate')))
|
||||
|
||||
Reference in New Issue
Block a user