【问题标题】:View not found error while sending email in Laravel在 Laravel 中发送电子邮件时查看未找到错误
【发布时间】:2017-08-15 20:08:20
【问题描述】:

我正在向用户发送 2 封电子邮件,一封在他注册时发送,另一封在他请求重置密码时发送(忘记密码功能)。上述两个函数的代码相似。但是,每当用户注册新帐户时,电子邮件都会成功发送,而我收到 View [] not found (View:/home/vagrant/Laravel/youtube/resources/views/emails/password/reset.blade.php) 错误。类似的代码,只是改变了文件名和一些后端逻辑。

这是发送邮件的代码(Mail Class)

public function build() {
        return $this->subject('Reset your password')
                    ->markdown('emails.password.reset')
                    ->text('emails.password.reset_text');
    }

这是降价文件emails/password/reset.blade.php

@component('mail::message')
<strong>Hello {{ $token->user->getFirstNameOrUserName() }}!</strong>

You are receiving this email because we received a password reset request for your account.
If you did not request a password reset, no further action is required.

@component('mail::button', [
    'url' => route('password.reset', ['token' => $token,]) . '?email=' . urlencode($token->user->email)
])
Reset Password
@endcomponent

Thanks,<br>
{{ config('app.name') }}
@endcomponent

<hr>
If you’re having trouble clicking the <strong>"Reset Password"</strong> button, copy and paste the URL below into your web browser:<br>
<small>{{ route('password.reset', ['token' => $token,]) . '?email=' . urlencode($token->user->email) }}</small>

@endcomponent

我收到View [] not found. (View: /home/vagrant/Laravel/youtube/resources/views/emails/password/reset.blade.php)

真的不知道为什么。我想,我需要第二双眼睛才能找出错误。

【问题讨论】:

    标签: laravel-5


    【解决方案1】:

    我找到了答案,无论出于何种原因,我在我的降价模板中两次关闭(结束)降价组件@endcomponent

    【讨论】:

      猜你喜欢
      • 2019-11-22
      • 2020-06-02
      • 2021-07-22
      • 2015-09-07
      • 1970-01-01
      • 1970-01-01
      • 2016-07-12
      • 2018-10-08
      相关资源
      最近更新 更多