I believe you're getting that error is because ->attach() is looking for a string (basename path) to the file. You are passing in $this->pdf, which is the Laravel Snappy object.
I think what you need to do is first export the pdf to a temporary file, and then pass the path to that file to attach()
Something like:
$this->path = 'some/temporary/location/freightbill.pdf';
$this->pdf = PDF::loadFile('shipments.pdf', compact('shipment','shipment_details'))
->setOption('images', true)
->setOption('enable-javascript', true)
->setOption('javascript-delay', 100)
->save($this->path);
then:
return $this->from('[email protected]')
->subject('New Freight Bill Created - '. $this->proNumber)
->view('emails.shipments.created')
->attach($this->path, [
'as' => 'freightbill.pdf',
'mime' => 'application/pdf',
]);
You would need to take care of some garbage collection to remove the temporary file after the email has been delivered.