首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何发送自定义密码重置链接在laravel (自定义链接前缀)?

如何发送自定义密码重置链接在laravel (自定义链接前缀)?
EN

Stack Overflow用户
提问于 2020-12-02 15:47:18
回答 1查看 1.8K关注 0票数 0

I Laravel自定义认证(Laravel Breeze)。我想发送我的定制密码重置链接。默认情况下,该链接以localhost:8000/reset-password/{token}格式发送,但我希望发送链接localhost:8000/system/reset-password/{token}.。

代码语言:javascript
复制
Route
// forgot-password
    Route::get('/forgot-password',[AdminForgotPasswordController::class,'create'])->name('admin.showForgotPassword');
    Route::post('/forgot-password',[AdminForgotPasswordController::class,'store'])->name('admin.forgotPassword');
代码语言:javascript
复制
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)]);
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-02 15:50:47

遵循关于密码重置的Laravel文档,您将能够覆盖密码重置链接!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65111450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档