Laravel 5.5密码重置成功自定义参数未被传递

时间:2018-04-06 13:45:27

标签: php laravel laravel-5

我创建了自己的视图,一旦密码成功重置就会显示。

我正在尝试将用户的电子邮件传递给此视图,因此我修改了处理重定向的ResetPasswords特征:

protected function sendResetResponse($response, $request)
    {
        return redirect($this->redirectPath())
                            ->with('status', trans($response))->with('email', $request->email);
    }

这应该将值传递给视图,我的视图文件(reset-success.blade.php):

@extends('quarx-frontend::layout.master')

@section('content')

<div class="row raw-margin-top-72 text-center">

        <h1 class="text-center">Password successfully changed!</h1>

        {{ $email  }}

</div>

@stop

但我一直收到以下错误:

  

未定义变量:电子邮件(查看:   C:\瓦帕\ WWW \一个-API \资源\视图\ AUTH \密码\复位success.blade.php)

1 个答案:

答案 0 :(得分:0)

看起来你直接覆盖了这个特性,这是不正确的,你应该在你的app/http/Controllers/Auth/ResetPasswordController.php控制器中覆盖它;如果您直接在供应商文件夹中对其进行修改,则下次进行作曲家更新/安装时,会离开

只需将代码复制到那里就可以了:

protected function sendResetResponse($response, $request){
  return redirect($this->redirectPath())
       ->with(['email => $request->email, 'status' => trans($response)]);
}

然后,您可以安全地更改作曲家安装/更新。

相关问题