title: Attaching PDF generated through Laravel to Mailable
body: <p>At the moment I currently use <a href="https://github.com/barryvdh/laravel-snappy" rel="nofollow noreferrer">laravel-snappy</a> to generate my PDFs from pages, I do this primarily because it plays really nice with some JavaScript scripts I have on a few of my generated pages. </p>
  
  <p>I know it's possible to attach an attachment of sorts to a mailable, which is what I have been using at the suggestions of others until the notifiables get a few more things worked on with them.</p>
  
  <p>But I am stuck as to whether or not it's possible to attach a generated PDF to a mailable.</p>
  
  <p>At the moment, I send the PDFs to generate through a route:</p>
  
  <pre><code>Route::get('/shipments/download/{shipment}','ShipmentController@downloadPDF');
  </code></pre>
  
  <p>Which is then sent to here in the controller:</p>
  
  <pre><code>  public function downloadPDF(Shipment $shipment){
              $shipment_details = $shipment-&gt;shipment_details;
  
              $pdf = PDF::loadView('shipments.pdf', compact('shipment','shipment_details'))
                      -&gt;setOption('images', true)
                      -&gt;setOption('enable-javascript', true)
                      -&gt;setOption('javascript-delay', 100);
              return $pdf-&gt;download('shipment'.$shipment-&gt;url_string.'.pdf');
          }
  </code></pre>
  
  <p>My mailable is defined as such:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Mail;
  
  use Illuminate\Bus\Queueable;
  use Illuminate\Mail\Mailable;
  use Illuminate\Queue\SerializesModels;
  use Illuminate\Contracts\Queue\ShouldQueue;
  
  use App\Shipment;
  
  class newFreightBill extends Mailable
  {
      use Queueable, SerializesModels;
  
      /**
       * Create a new message instance.
       *
       * @return void
       */
      public $shipment;
  
      public function __construct(Shipment $shipment)
      {
          $this-&gt;shipment = $shipment;
          $this-&gt;attachmentURL = $shipment-&gt;url_string;
          $this-&gt;proNumber = $shipment-&gt;pro_number;
      }
  
      /**
       * Build the message.
       *
       * @return $this
       */
      public function build()
      {
          return $this-&gt;from('billing@cmxtrucking.com')
                      -&gt;subject('New Freight Bill Created - '. $this-&gt;proNumber)
                      -&gt;view('emails.shipments.created');
      }
  }
  </code></pre>
  
  <p>So, is it possible to attach a generated PDF?</p>