3
如果我想更改密碼,代碼工作正常,不要 顯示任何錯誤,但如果您想用新的密碼登錄,看起來不正確。我在數據庫中看到,沒有密碼更改。我無法更改用戶的密碼
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();
}
排字錯誤=> $ user-> update(['password'=> bcrypt($ request-> password)]); – JYoThI
謝謝JYoThi,這是工作。感謝您的支持。 –
很高興爲您效勞 – JYoThI