Kogan
4 months ago
405
2
Laravel

Display pdf file in blade

Posted 4 months ago by Kogan

Hello. I want to display my pdf file from storage to blade. but i dont know how to do it. I did some search and I found out this code.

   $filename = 'app\final\attachments3456\mypdf.pdf';

   $path = storage_path($filename);
                
   return Response::make(file_get_contents($path), 200, [
              'Content-Type' => 'application/pdf',
              'Content-Disposition' => 'inline; filename="'.$filename.'"'
   ]);

then, how can i display my pdf file in blade?

Please sign in or create an account to participate in this conversation.