如果我想更改密码,代码工作正常,请勿 显示任何错误,但如果您想使用新的登录,它看起来不正确 密码。我在数据库中看到,没有密码更改。
public function postPasswordReset(Request $request)
{
$validator = validator::make($request->all(), [
'email' => 'required|exists:users,email',
'password' => 'required|alpha_num|between:6,32',
're-password' => 'required|same:password'
]);
if($validator->passes()){
$user = User::where('email', $request->email)->first();
$user->update(['password' bcrypt($request->password)]);
return redirect()->route('auth.login');
}
return redirect()->back()->withErrors($validator->errors())-
>withInput();
}
答案 0 :(得分:2)
在您的更新方法中,您使用的数组以错误的格式更新。试试这个
$user->update(['password' => bcrypt($request->password)]);