sha*_*ent 3 verification laravel
在注册过程中,发送验证电子邮件时出现添加 {locale} 的问题。数据正在添加到数据库中。但此后给出了以下问题。
缺少 [路由:verification.verify] [URI:{locale}/email/verify/{id}/{hash}] 所需的参数。
我认为这将是某种形式的超越验证过程。
Route::group([
'prefix' => '{locale}',
'where' => ['locale' => '[a-zA-Z]{2}'],
'middleware' => 'setlocale'], function() {
Auth::routes(['verify' => true]);
Route::get('/home', 'HomeController@index')->name('home');
});
Route::get('/', function () {
return redirect(app()->getLocale());
});
Run Code Online (Sandbox Code Playgroud)
$this->get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');
Run Code Online (Sandbox Code Playgroud)
我知道路由器 {locale} 与路由不匹配。但如何解决这个问题呢?
而不是使用Auth::routes(['verify' => true]);仅使用Auth::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');
Route::group([ 'prefix' => '{locale}', 'where' => ['locale' => '[a-zA-Z]{2}'], 'middleware' => 'setlocale'], function() {
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
});
Run Code Online (Sandbox Code Playgroud)
检查答案。
| 归档时间: |
|
| 查看次数: |
5478 次 |
| 最近记录: |