title: laravel 8 and Laravel-dompdf via API
body: <p>is there a way to generate a pdf file from controller to vue js component via api route??</p>
  <pre><code>public function usersPrintPdf()
      {
          $data = [
              'title' =&gt; 'First PDF for Medium',
              'heading' =&gt; 'Hello from 99Points.info',
              'content' =&gt; 'Lorem Ipsum is simply dummy text remaining essentially unchanged.'
          ];
  
          $pdf = PDF::loadView('pdfs/pdf_view', $data);
          return $pdf-&gt;download('users.pdf');
      }
  </code></pre>
  <p>and on api.php</p>
  <pre><code>Route::get('users/print-pdf', [UserController::class, 'usersPrintPdf']);
  </code></pre>