email attach in laravel emial code example
Example: laravel notification attach file
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->line('Please download the PDF.')
->attach(public_path($this->filename), [
'as' => 'filename.pdf',
'mime' => 'text/pdf',
]);
}