Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cygeorgel/4565842c024d68f0631c95589bda5547 to your computer and use it in GitHub Desktop.
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
// 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