title: Attach PDF file into a Mail
body: <p>I try to attach a pdf file from a view wish is working in PDF. but when i try to attach this as a PDF file into an email , i get </p>
  
  <blockquote>
    <p>Swift_IoException in FileByteStream.php line 144: Unable to open file
    for reading [HTTP/1.0 200 OK Cache-Control: no-cache, private
    Content-Disposition: attachment; filename="invoice.pdf" Content-Type:
    application/pdf</p>
  </blockquote>
  
  <p>Someone know where i am doing it wrong ? thanks a lot in advance </p>
  
  <p>Here my controller : </p>
  
  <p>public function build()
      {</p>
  
  <pre><code>    $federation = Structure::where('id' , '1')-&gt;first();
      $structure = Structure::where(['id' =&gt; $this-&gt;order-&gt;structure_id])-&gt;first();
      $order = $this-&gt;order;
  
      $url = url('/cotisationstructure/'.$this-&gt;order-&gt;id);
  
      $pdf = app('dompdf.wrapper');
      $pdf-&gt;loadView('cotisation_structure.facturePDFsingle', compact('order' , 'structure' , 'federation'));
  
      return $this-&gt;markdown('email.commande' ,compact('federation' , 'structure' , 'url'))
          -&gt;subject('Nouvelle Achat de Licences sur FFRXIII Licences &amp; Compétitions')
          -&gt;attach($pdf-&gt;download('invoice.pdf'));
  }
  </code></pre>