本文介绍: 先说下情况,就是我要做一个发送附件邮件发送功能结果报错:The path cannot be empty。一检查这里变量没值,所以,才导致了这个问题。给我整的有点迷糊,网上没有类似的问题记录一下,希望有用。
先说下情况,就是我要做一个发送附件的邮件发送功能结果报错:The path cannot be empty。

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

后来,我检查了一下代码发现有个地方,是需要给附件文件地址的:
   /**
     * Get the mail representation of the notification.
     *
     * @param mixed $notifiable
     * @return IlluminateNotificationsMessagesMailMessage
     */
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject('获取报告发送通知')
            ->view('emails.sendReportFile',['data'=>$notifiable->data])
            ->attach($notifiable->report_url);
    }
$notifiable->report_url这个。

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

记录一下,希望有用。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注