How does one go about attaching multiple files to laravel 5.3 mailable?
I can attach a single file easily enough using ->attach($form->filePath)
on my mailable build method. However, soon as I change the form field to array I get the following error:
basename() expects parameter 1 to be string, array given
I've searched the docs and also various search terms here on stack to no avail. Any help would be greatly appreciated.
Build Method:
public function build()
{
return $this->subject('Employment Application')
->attach($this->employment['portfolio_samples'])
->view('emails.employment_mailview');
}
Mail Call From Controller:
Mail::to(config('mail.from.address'))->send(new Employment($employment));
$attachments
as the internal Mailable class already has a property with the name$attachments
. Using the same name overwrites the property and causes errors. – Timeless