Created
June 21, 2018 11:53
-
-
Save cygeorgel/4565842c024d68f0631c95589bda5547 to your computer and use it in GitHub Desktop.
Get Pdf document from Ovh public cloud storage and show it in browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get Pdf document from Ovh public cloud storage and show it in browser | |
$invoice = Invoice::find($id); | |
if($invoice->file == true) { | |
$filename = $invoice->number . '.pdf'; | |
$document = Storage::disk('swift')->get('production/' . $invoice->batch . '/invoices-pdf/' . $filename); | |
return Response::make($document, 200, [ | |
'Content-Type' => 'application/pdf', | |
'Content-Disposition' => 'inline; ' . $filename, | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment