How I can stream pdf files instead of downloading in Laravel?

  dompdf, laravel, pdf, pdf-generation

I currently using barryvdh/laravel-dompdf for printing pdf. But whenever I click on the print button it always downloads the file instead of opening a browser tab. How I can fix this ??? I’ve seen others post but I didn’t get the right solution too.

$customer = Customer::findOrFail($id);
$pdf = PDF::loadView('', $customer);
return $pdf->stream('info.pdf');

Source: Laravel

Leave a Reply