On Laravel 5.7 Email verification feature added. But on my project i do not use the default route names and added a prefix for my own purpose. Now when i added following code to add the verify routes, it shows an error.
Auth::routes(['verify' => true]);
Error message shows that the verification.verify
route does not exists. Where can i update this route name in my project? Or is it the only way to use this feature is to follow the default Auth Route names?
Project Source Code Is available at https://github.com/nasirkhan/laravel-starter/tree/l57
Instead of using Auth::routes(['verify' => true]);
just use Auth::routes();
and manually add these routes:
Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
Then customise as you want :)
Anyone who gets here and is looking for tompec's version for the latest Laravel, use the below. Notice the addition of /{hash}
.
$this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
$this->get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');
$this->post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With