首页 > 解决方案 > 没有为 [mail] Laravel 8 定义提示路径

问题描述

在我的 Laravel 项目中,我正在尝试使用电子邮件发件人,并且我在队列中使用 Mailable 和作业,并且工作正常,但现在我正在尝试使用降价发送电子邮件,并且由于某种原因无法正常工作 bcs 这个错误: “没有为 [mail] 定义提示路径”

在可邮寄:

{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('emails.orders.shipped',['url'=>'www.google.com']);
    }
} 

这是刀片视图,它是 Laravel 文档的默认示例:

@component('mail::message')
# Introduction

The body of your message.

@component('mail::button', ['url' => $url])
Button Text
@endcomponent

Thanks,<br>
@endcomponent

我需要传递一个将成为字符串的 url。

标签: phplaravelemaillaravel-8

解决方案


我试过这个脚本它工作正常可能是缓存的问题你可以试试这个命令

php artisan optimize:clear

推荐阅读