我应该在哪里为 UrlGenerator 定义电子邮件?
Where have I to define email for UrlGenerator?
我想在我的 lumen 8.0 应用程序中添加重置密码功能
正在阅读 篇文章,但出现错误:
: Route [password.reset] not defined. at /mnt/_work_sdb8/wwwroot/LumenProjects/PublishPagesAPI/vendor/laravel/lumen-framework/src/Routing/UrlGenerator.php:231)
并检查我在 Notifications/ResetPassword 中看到的相关代码。php:
public function toMail($notifiable)
{
\Log::info( varDump($notifiable, ' -1 $notifiable::') );
\Log::info( varDump(static::$toMailCallback, ' -2 static::$toMailCallback::') );
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
}
\Log::info( varDump(static::$createUrlCallback, ' -3 static::$createUrlCallback::') );
if (static::$createUrlCallback) {
$url = call_user_func(static::$createUrlCallback, $notifiable, $this->token);
} else {
$url = url(route('password.reset', [
'token' => $this->token,
'email' => $notifiable->getEmailForPasswordReset(),
], false));
}
return $this->buildMailMessage($url);
}
并检查我看到的日志:
[2021-07-01 13:35:04] local.INFO: NULL : -2 static::$toMailCallback:: : NULL
[2021-07-01 13:35:04] local.INFO: NULL : -3 static::$createUrlCallback:: : NULL
看起来我必须在某些配置文件中设置这些变量?
您能否指出参数的位置和参数?
此外,由于本文是为 lumex 5 编写的,如果通知是 lumen 8 的正确决定?
谢谢!
有效决定是将 config/auth.php 更新为:
'password' => [
'users' => [
'provider' => 'users',
'email' => 'auth.emails.password',
'table' => 'passwords_resets',
'expire' => 60,
],
]
我想在我的 lumen 8.0 应用程序中添加重置密码功能
正在阅读
: Route [password.reset] not defined. at /mnt/_work_sdb8/wwwroot/LumenProjects/PublishPagesAPI/vendor/laravel/lumen-framework/src/Routing/UrlGenerator.php:231)
并检查我在 Notifications/ResetPassword 中看到的相关代码。php:
public function toMail($notifiable)
{
\Log::info( varDump($notifiable, ' -1 $notifiable::') );
\Log::info( varDump(static::$toMailCallback, ' -2 static::$toMailCallback::') );
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
}
\Log::info( varDump(static::$createUrlCallback, ' -3 static::$createUrlCallback::') );
if (static::$createUrlCallback) {
$url = call_user_func(static::$createUrlCallback, $notifiable, $this->token);
} else {
$url = url(route('password.reset', [
'token' => $this->token,
'email' => $notifiable->getEmailForPasswordReset(),
], false));
}
return $this->buildMailMessage($url);
}
并检查我看到的日志:
[2021-07-01 13:35:04] local.INFO: NULL : -2 static::$toMailCallback:: : NULL
[2021-07-01 13:35:04] local.INFO: NULL : -3 static::$createUrlCallback:: : NULL
看起来我必须在某些配置文件中设置这些变量? 您能否指出参数的位置和参数?
此外,由于本文是为 lumex 5 编写的,如果通知是 lumen 8 的正确决定?
谢谢!
有效决定是将 config/auth.php 更新为: 'password' => [ 'users' => [ 'provider' => 'users', 'email' => 'auth.emails.password', 'table' => 'passwords_resets', 'expire' => 60, ], ]