路由[user.verification.notice]未定义/覆盖确保EmailIsVerified? [英] Route [user.verification.notice] not defined / Override EnsureEmailIsVerified?

查看:276
本文介绍了路由[user.verification.notice]未定义/覆盖确保EmailIsVerified?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试实现多个身份验证登录,并且两个组中的注册均正常进行,但是用户注册后验证路由不起作用.有什么办法可以做到这一点?

I've been trying to implement multiple authentication login and registration is working fine in both group but verification route is not working after user registration. Is there any way possible to do this ?

这是我的路线

Route::group([
                'prefix'    => 'users',
                'namespace' => 'Users',
                'as'        => 'user.'
            ],function(){
                Auth::routes(['verify' => true]);
                Route::get('/','Main@index');
                Route::get('/dashboard','Main@index')->name('dashboard');
            });
Route::group([
                'prefix'    => 'admins',
                'namespace' => 'Admins',
                'as'        => 'admin.'
            ],function(){
                Auth::routes();
                Route::get('/','Main@index');
                Route::get('/dashboard','Main@index')->name('dashboard');
            });

推荐答案

好吧,我搜索了很多东西,但是唯一的方法是手动处理,所以我更新了路线,并且在这里起作用的是代码,

Okay, I searched a lot but the only way is to handle by manually so I updated my route and it worked here is the code,

Route::group([
                'prefix'    => 'admins',
                'namespace' => 'Admins',
                'as'        => 'admin.'
            ],function(){
                Auth::routes();
                Route::get('/','Main@index');
                Route::get('/dashboard','Main@index')->name('dashboard');
            });

Route::get('email/verify', 'Users\Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}', 'Users\Auth\VerificationController@verify')->name('verification.verify');
Route::get('email/resend', 'Users\Auth\VerificationController@resend')->name('verification.resend');
Route::group([
                'prefix'    => 'users',
                'namespace' => 'Users',
                'as'        => 'user.'
            ],function(){
                Auth::routes();
                Route::get('/','Main@index');
                Route::get('/dashboard','Main@index')->name('dashboard');
            });

我还想知道,如果Auth::routes(['verify' => true]);自己处理所有事情是否会更容易,更简单,那么我们唯一需要管理的就是VerificationController中的 show method ,我希望他们对此进行更新在即将发布的Laravel版本中出现问题,但也有可能我不知道另一种方式,任何帮助或建议都应感谢.

Also I wonder if it would be much easier and simpler if Auth::routes(['verify' => true]); handles all by itself then only thing we've to manage is show method in VerificationController, I hope they update this issue in upcoming Laravel versions, but it is also possible that I'm not aware of another way to do it, any help or suggestion appreciated.

这篇关于路由[user.verification.notice]未定义/覆盖确保EmailIsVerified?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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