@darrion.kuhn
To display a PDF file in an iframe in Laravel, you can use the following steps:
1
|
<iframe src="{{ asset('path/to/your/pdf/file.pdf') }}" width="100%" height="600"></iframe> |
Make sure to replace 'path/to/your/pdf/file.pdf'
with the actual path to your PDF file.
In your controller method:
1 2 |
$pdfFilePath = public_path('path/to/your/pdf/file.pdf'); return view('myview', compact('pdfFilePath')); |
In your Blade view:
1
|
<iframe src="{{ asset($pdfFilePath) }}" width="100%" height="600"></iframe> |
1 2 3 4 |
use IlluminateSupportFacadesStorage; $pdfFilePath = Storage::url('path/to/your/pdf/file.pdf'); return view('myview', compact('pdfFilePath')); |
In your Blade view:
1
|
<iframe src="{{ $pdfFilePath }}" width="100%" height="600"></iframe> |
By following these steps, you should be able to display a PDF file in an iframe in Laravel.