I Laravel自定义认证(Laravel Breeze)。我想发送我的定制密码重置链接。默认情况下,该链接以localhost:8000/reset-password/{token}格式发送,但我希望发送链接localhost:8000/system/reset-password/{token}.。
Route
// forgot-password
Route::get('/forgot-password',[AdminForgotPasswordController::class,'create'])->name('admin.showForgotPassword');
Route::post('/forgot-password',[AdminForgotPasswordController::class,'store'])->name('admin.forgotPassword');controller
public function store(Request $request)
{
$request->validate([
'email' => 'required|email',
]);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$status = Password::sendResetLink(
$request->only('email')
);
return $status == Password::RESET_LINK_SENT
? back()->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
}发布于 2020-12-02 15:50:47
遵循关于密码重置的Laravel文档,您将能够覆盖密码重置链接!
https://stackoverflow.com/questions/65111450
复制相似问题