【问题标题】:How to send custom password reset link in laravel (customized link with prefix)?如何在 laravel 中发送自定义密码重置链接(带前缀的自定义链接)?
【发布时间】: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


    【解决方案1】:

    the Laravel documentation about Password Reset 之后,您将能够覆盖密码重置链接!

    【讨论】:

      猜你喜欢
      • 2018-04-07
      • 2016-09-23
      • 1970-01-01
      • 2020-08-16
      • 1970-01-01
      • 2015-12-25
      • 1970-01-01
      • 2019-04-10
      • 1970-01-01
      相关资源
      最近更新 更多