Php 如何在视图中显示存储器中的pdf文件

Php 如何在视图中显示存储器中的pdf文件,php,laravel,Php,Laravel,我研究了如何在blade中显示pdf文件。我找到了这个答案。但是我应该在blade中做什么来显示文件呢 $filename = 'test.pdf'; $path = storage_path($filename); return Response::make(file_get_contents($path), 200, [ 'Content-Type' => 'application/pdf', 'Content-Disposition' =>

我研究了如何在blade中显示pdf文件。我找到了这个答案。但是我应该在blade中做什么来显示文件呢

  $filename = 'test.pdf';
  $path = storage_path($filename); 

  return Response::make(file_get_contents($path), 200, [
      'Content-Type'
  => 'application/pdf',


  'Content-Disposition' => 'inline; filename="'.$filename.'"'
如何在blade中显示结果(pdf)?


<iframe src="path_of_pdf_file" width ="100%" height="600px"></iframe>

我的意思是如何在blade中显示结果的可能重复?请对您的代码添加一些解释,特别是关于
pdf文件的路径
“pdf文件的路径”指存储pdf的本地路径。您需要在src属性中指定pdf文件路径。