mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
download billing documents
This commit is contained in:
@@ -23,7 +23,7 @@ class DownloadBookingDocumentLogic
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return bool
|
||||
* @return void
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute(Request $request)
|
||||
@@ -48,7 +48,15 @@ class DownloadBookingDocumentLogic
|
||||
}
|
||||
|
||||
$zip->close();
|
||||
return Storage::disk('documents')->download('collections/' . $zip_file);
|
||||
|
||||
header('Content-Type: application/zip');
|
||||
header('Content-Disposition: attachment; filename="'.basename($attachment).'"');
|
||||
header('Content-Length: ' . filesize($attachment));
|
||||
|
||||
flush();
|
||||
readfile($attachment);
|
||||
// delete file
|
||||
unlink($attachment);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ class DownloadBookingDocumentController
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param DownloadBookingDocumentLogic $logic
|
||||
* @return bool
|
||||
* @return void
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function download(Request $request, DownloadBookingDocumentLogic $logic) {
|
||||
return $logic->execute($request);
|
||||
$logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user