trevorpan's avatar

Upgrading to 6.0; Email Verification Route Change when using Auth::routes(['verify' => true]);

https://laravel.com/docs/6.x/upgrade#email-verification-route-change

The route path for verifying emails has changed from /email/verify/{id} to /email/verify/{id}/{hash}.

When I view routes\web.php I don't see the routes to change.

I've been looking all over for the file to make this change. Do you know where it is? I used php artisan make:auth in the 5.8 laravel, and have now upgraded to 6.0.

//web.php
Auth::routes(['verify' => true]);

if you use command+F7 in phpstorm it shows these two classes; when you open them they don't have the email routes.

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

Thank you, Trevor

0 likes
5 replies
bobbybouwmann's avatar
Level 88

Since you use Auth::routes these routes are automatically created for you. You can see them when running php artisan route:list. The reason why this is in the upgrade guide is that the URL now changed. So your old routes are not working anymore, so old emails as well with the link are not working anymore.

Also if you use any custom code that points to this route, you need to make sure you make a change there as well. If you didn't change anything about the verification steps yourself this should just work out of the box ;)

trevorpan's avatar

Ha! thank you @bobbybouwmann .

I wish the docs mentioned that; I can see the {hash} was added to the route after running composer update.

Forgot about the php artisan route:list command. Even still, how do you locate the file where the routes are stored? I'm using phpstorm.

Please or to participate in this conversation.