問題描述
我正在嘗試在 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] 未定義的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!