沃梦达 / 编程问答 / php问题 / 正文

Laravel 5.7 邮件验证错误,路由 [verification.verify]

Laravel 5.7 email verification error, route [verification.verify] not defined(Laravel 5.7 邮件验证错误,路由 [verification.verify] 未定义)

本文介绍了Laravel 5.7 邮件验证错误,路由 [verification.verify] 未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Laravel 5.7 中实现电子邮件验证.我已经在 User 模型上实现了 MustVerifyEmail.

I am trying to implement email verification in Laravel 5.7. I have implemented MustVerifyEmail on User model.

class User extends Authenticatable implements MustVerifyEmail 
{ 
}

但注册后我收到此错误Route [verification.verify] not defined.

But after registration I got this error Route [verification.verify] not defined.

我缺少什么?请指导?

推荐答案

Laravel 包含 AuthVerificationController 类,该类包含发送验证链接和验证电子邮件的必要逻辑.要为此控制器注册必要的路由,请将 verify 选项传递给 Auth::routes 方法:

Laravel includes the AuthVerificationController class that contains the necessary logic to send verification links and verify emails. To register the necessary routes for this controller, pass the verify option to the Auth::routes method:

Auth::routes(['verify' => true]);

您可以在此处阅读更多信息:https://laravel.com/docs/5.7/verification

You can read more information here : https://laravel.com/docs/5.7/verification

这篇关于Laravel 5.7 邮件验证错误,路由 [verification.verify] 未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Laravel 5.7 邮件验证错误,路由 [verification.verify]

基础教程推荐