📜  laravel 通知附件 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:36.636000             🧑  作者: Mango

代码示例1
/**
     * 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',
                    ]);
    }