Search
 
SCRIPT & CODE EXAMPLE
 

PHP

display pdf file in laravel

Route::get('/pdf/{file}', function ($file) {
      // file path
     $path = public_path('storage/file' . '/' . $file);
      // header
     $header = [
       'Content-Type' => 'application/pdf',
       'Content-Disposition' => 'inline; filename="' . $file . '"'
     ];
    return response()->file($path, $header);
})->name('pdf');
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress add button to admin bar 
Php :: strrev php 
Php :: laravel logout all users 
Php :: return message in laravel 
Php :: laravel eloquent duplicate record 
Php :: two condition in one laravel query 
Php :: wordpress limit post content length 
Php :: wordpress - php settings 
Php :: parse json phph 
Php :: mail() function in php not working 
Php :: xampp php 5.6 download 64 bit 
Php :: laravel permission 
Php :: how to save and get checkbox value in database php 
Php :: laravel import csv to database 
Php :: pagination in codeigniter with example 
Php :: spaceship operator php 
Php :: not equal in laravel blade 
Php :: transforming string to integer in php 
Php :: laravel collection first 
Php :: magento 1.9 get all product 
Php :: custom fields wordpress 
Php :: Drupal 8 custom form image field 
Php :: resource route controller laravel 8 
Php :: php prepared statements 
Php :: insert array values in database using codeigniter 
Php :: PHP temporary files 
Php :: variables in php 
Php :: SUM with Eloquent 
Php :: specify php version composer 
Php :: laravel https middleware 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =