Laravel 5.7电子邮件验证路线 [英] Laravel 5.7 Email Verification Routes

查看:54
本文介绍了Laravel 5.7电子邮件验证路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Laravel 5.7上添加了电子邮件验证功能.但是在我的项目中,我不使用默认的路由名称,而是出于自己的目的添加了前缀.现在,当我添加以下代码以添加验证路由时,它会显示错误.

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]);

错误消息表明 verification.verify 路由不存在.我在哪里可以在我的项目中更新此路线名称?还是使用此功能的唯一方法是遵循默认的身份验证路由"名称?

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?

项目源代码位于> https://github.com/nasirkhan/laravel-starter/tree/l57

推荐答案

不是使用 Auth :: routes(['verify'=> true]); ,而是使用 Auth::routes(); 并手动添加以下路由:

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 :)

这篇关于Laravel 5.7电子邮件验证路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆