title: laravel mpdf: Save into database after streaming
body: <p>so I'm trying to create a pdf, using niklasravnsborg/laravel-pdf library and then save the result as a .pdf file in Storage and save the name in a database in order to re-access it later and make a Show and E-mail functions.
  The logic will be something like this.</p>
  
  <pre><code>  elseif ($request-&gt;type =='full_time') {
      $pdf = PDF::loadview('employee.contract_full_pdf', ['request'=&gt;$request]);
  
      $name = 'contract'.time().$request-&gt;id.'.'.'.pdf';
      Storage::put($name, $pdf);
      $employee-&gt;contract= $name;
  
      return $pdf-&gt;stream ('full-time_contract.pdf');
      }
  </code></pre>
  
  <p>Any help or tips on how to approaches this and also the best practices information will be appreciated!</p>
  
  <p>Note: the $pdf->Output('Filename', 'F'); method didn't work for me and didn't store the file, didn't throw an error either.</p>