Pel*_*lle 5 php routing laravel laravel-6
我正在尝试从 5.8 升级到 Laravel 6。我们使用Notification带有以下代码的自定义验证电子邮件来获取验证 URL:
URL::temporarySignedRoute(
'verification.verify',
Carbon::now()->addMinutes(60),
[
'id' => $notifiable->getKey(),
]
);
Run Code Online (Sandbox Code Playgroud)
这似乎生成了一个不适用于新路由的 URL(检查这个),例如:
URL::temporarySignedRoute(
'verification.verify',
Carbon::now()->addMinutes(60),
[
'id' => $notifiable->getKey(),
]
);
Run Code Online (Sandbox Code Playgroud)
到目前为止,我在网上找不到关于该特定主题的任何内容,因此如果您能帮助我使其在 Laravel 6 中正常工作,我将不胜感激。
提前致谢。
好的,我在以下位置找到了解决方案:
vendor/laravel/framework/src/Illuminate/Auth/Notifications/VerifyEmail.php
不得不将代码更改为:
return URL::temporarySignedRoute(
'verification.verify',
Carbon::now()->addMinutes(60),
[
'id' => $notifiable->getKey(),
'hash' => sha1($notifiable->getEmailForVerification()),
]
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3329 次 |
| 最近记录: |