use IlluminateSupportFacadesHash;
$user = User::findOrFail($id);
/*
* Validate all input fields
*/
$request->validate([
'password' => 'required',
'new_password' => 'confirmed|max:8|different:password',
]);
if (Hash::check($request->password, $user->password)) {
$user->fill([
'password' => Hash::make($request->new_password)
])->save();
return redirect()->route('your.route')->with('success', 'Password changed');
} else {
return redirect()->route('your.route')->with('error', 'Password does not match');
}