先说下情况,就是我要做一个发送附件的邮件发送功能,结果,报错:The path cannot be empty。

给我整的有点迷糊,网上也没有类似的问题。

后来,我检查了一下代码,发现有个地方,是需要给附件文件地址的:

/**

* Get the mail representation of the notification.

*

* @param mixed $notifiable

* @return \Illuminate\Notifications\Messages\MailMessage

*/

public function toMail($notifiable)

{

return (new MailMessage)

->subject('获取报告发送通知')

->view('emails.sendReportFile',['data'=>$notifiable->data])

->attach($notifiable->report_url);

}

$notifiable->report_url就这个。

一检查这里的变量没值,所以,才导致了这个问题。

记录一下,希望有用。

文章链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: