【问题标题】:Password Reset in Lumen 5.3Lumen 5.3 中的密码重置
【发布时间】:2017-08-16 12:09:08
【问题描述】:

我正在尝试在 Lumen 5.3 中创建 PasswordReset API。

我在默认的 Laravel 5.3 应用程序中设置了相同的设置。

$app->post('/password/email', 'PasswordController@postEmail');
$app->post('/password/reset/{token}', 'PasswordController@postReset');

在用户模型中,我重写了如下方法:

public function sendPasswordResetNotification($token)
{
        $this->notify(new ResetPasswordNotification($token));
}

我已经手动拉入 Lumen 5.3 的通知包

但是,我收到以下错误:

BindingResolutionException in Container.php line 763:
Target [Illuminate\Contracts\Mail\Mailer] is not instantiable while building [Illuminate\Notifications\Channels\MailChannel].

我在这里错过了什么?

【问题讨论】:

  • 我也有同样的问题,你找到解决办法了吗

标签: laravel-5.3 lumen lumen-5.3


【解决方案1】:

在您的bootstrap/app.php 中添加以下行

$app->alias('mailer', \Illuminate\Contracts\Mail\Mailer::class);

【讨论】:

    猜你喜欢
    • 2016-09-17
    • 2017-09-28
    • 2017-03-03
    • 2020-03-11
    • 2017-01-22
    • 2017-10-21
    • 2017-03-14
    • 2017-04-05
    • 1970-01-01
    相关资源
    最近更新 更多