title: Displaying .pdf file in browser with PHP in Laravel 7 using RESTful Controller
body: <p>I'm working on a laravel project and inside the project i store <code>.pdf</code> files to my local phpmyadmin and retrieve it back to display in the browser.</p>
  
  <p>I see some applications but they're saving the <code>.pdf</code> files locally while uploading it to DB. And then it becomes so easy to display with <code>&lt;img src=""&gt;</code> but i don't want to use this.</p>
  
  <p>These are my routes;</p>
  
  <pre><code>Route::get('/users/{user}/posts', 'PostController@index');
  Route::get('/posts/create', 'PostController@create');
  Route::post('/posts', 'PostController@store');
  </code></pre>
  
  <p>And index function;</p>
  
  <pre><code>public function index(User $user, Post $posts)
      {
          $posts = DB::table('posts')
                          -&gt;where('userId', '=', $user-&gt;id)
                          -&gt;get();
  
          return view('post.index', compact('posts'));
      }
  </code></pre>
  
  <p>I can upload and store <code>.pdf</code> files that OK but cannot display in the browser.
  So I want to get the record with index function in PostController(which is done already) and display the <code>.pdf</code> file in index.blade.php file which comes from db.
  like this: <code>http://localhost/test.pdf</code>
  When i display it in the browser i can see only it's name. How can i read the file that i get it from <code>db</code>?</p>
  
  <p>Thank you for your answers.</p>