我将Laravel身份验证放在带有变量slug
的子域中。
当我提交重置密码时,我收到错误
缺少 [路由: 密码.重置] [URI: 密码/重置/{令牌}] 的必需参数
Route::domain('{business_slug}.' . env('APP_URL'))->middleware(['business.slug'])->group(function () {
Auth::routes();
});
public function showLinkRequestForm($business_slug)
{
return view('auth.passwords.email', ['business_slug' => $business_slug]);
}
{{ route('password.email', ['business_slug' => $business_slug]) }}
重置密码周期为:
Auth::routes()
路线如下所示:
// 1) Show I forget password page
Route::get('/password/reset', 'AuthForgetPasswordController@showLinkRequestForm')
->name('password.request');
// 2) Send the reset link to user's email
Route::post('/password/email', 'AuthForgetPasswordController@sendResetLinkEmail')
->name('password.email');
// At this point, you should receive an email with a url looking like:
// example.com/reset/password/123123
// where 123123 is your {token}
// 3) From that link in the email, show reset password page
Route::get('password/reset/{token}', 'AuthResetPasswordController@showResetForm')
->name('password.reset');
// 4) Reset the password
Route::post('password/reset', 'AuthResetPasswordController@reset');
您也可以尝试php artisan route:list
查看所有路线。
编辑:我认为这与您在电子邮件中获得的网址有关。在.env
文件中,确保APP_URL
正确;在您的情况下:
APP_URL=http://jurdekker.onlineroosters.test