I am trying to attach a pdf to an email. I am passing the details with the path to the file.
$details = [
'message' => 'Here is a new signed pdf',
'attachment' => $storage_path.'/app/public/'.$document_id.'.pdf'
];
Then I am attaching it to the build function
public function build()
{
return $this->subject($this->details['title'])->view('contracts.mail')->attachFromStorage($this->details['attachment']);
}
I get an error that the path is wrong.
[previous exception] [object] (League\Flysystem\FileNotFoundException(code: 0): File not found at path: home/forge/domain.com/storage/app/public/39861cca-5676-4c51-8478-bdb4de9a31bf.pdf at /home/forge/domain.com/vendor/league/flysystem/src/Filesystem.php:389)
If I SSH into the site I can see this document in views.
cd domain.com/storage/framework/views/