Laravel 5.7 email verification error, route [verification.verify] not defined
Solution 1
Laravel includes the Auth\VerificationController
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]);
You can read more information here : https://laravel.com/docs/5.7/verification
Solution 2
You are missing Auth::routes(['verify' => true])
in Routes\Web.php
.
I suggest watch this video, where it has explained in detail how email verification works in Laravel 5.7.
https://www.youtube.com/watch?v=dbmox3tgI2k
Solution 3
Run:
php artisan optimize:clear
It will clear your cache.
Solution 4
In routes/web.php
file, add following piece of code:
Auth::routes(['verify' => true]);
Ref: https://laravel.com/docs/5.7/verification#verification-routing
Admin
Updated on June 02, 2021Comments
-
Admin almost 3 years
I am trying to implement email verification in Laravel 5.7. I have implemented
MustVerifyEmail
onUser
model.class User extends Authenticatable implements MustVerifyEmail { }
But after registration I got this error
Route [verification.verify] not defined
.What I am missing in this? Please guide?
-
lasec0203 over 5 yearsthe docs seems to assume the reader already know where to place
Auth::routes(['verify' => true])
at. laravel.com/docs/5.7/verification#verification-routing