【发布时间】:2020-12-02 15:47:18
【问题描述】:
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)]);
}
【问题讨论】:
标签: laravel