3
votes

In registration process, while sending verification email issue with adding {locale}. Data is being added to database. But thereafter giving following issue.

Missing required parameters for [Route: verification.verify] [URI: {locale}/email/verify/{id}/{hash}].

I think it will be some type of overriding the verification process.

web.php

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());
});

vendor/laravel/framework/src/Illuminate/Routing/Router.php

$this->get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');

I know in router {locale} is not matching with the routing. But how to resolve this?

4
Show your web.php file code? and Route: verification.verify link code.Dilip Hirapara

4 Answers

2
votes

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

Route::group([ 'prefix' => '{locale}', 'where' => ['locale' => '[a-zA-Z]{2}'], 'middleware' => 'setlocale'], function() { 
    Auth::routes();
    Route::get('/home', 'HomeController@index')->name('home'); 
}); 

check SO answer.

0
votes

For Laravel 6 and 7 the verification.verify route is

'email/verify/{id}/{hash}'
0
votes

Laravel 6.0 - Custom email verification: temporarySignedRoute() URL not working with new route

Check this out if you're having this because for me it was a custom verify link

0
votes
Route::group(['prefix' => '{locale}',  'where' => ['locale' => '[a-zA-Z]{2}'], 'middleware' => 'setlocale'], function() {
    
    Auth::routes();
    Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

});
Route::get('email/verify', [App\Http\Controllers\Auth\VerificationController::class,'show'])->name('verification.notice');
Route::get('email/verify/{id}', [App\Http\Controllers\Auth\VerificationController::class,'verify'])->name('verification.verify');
Route::post('email/resend', [App\Http\Controllers\Auth\VerificationController::class,'resend'])->name('verification.resend');

Resend should be Post method! This works in Laravel 8.0