I want to create form with 3 field (old_password, new_password, confirm_password) with laravel 5.
View
old password :
{!! Form::password(
Laravel 6 Check Old Password and Updating a New Password
public function updatePassword(Request $request)
{
$this->validate($request, [
'old_password' => 'required',
'new_password' => 'required|min:6',
'confirm_password' => 'required|same:new_password',
]);
$data = $request->all();
if(!\Hash::check($data['old_password'], auth()->user()->password)){
return back()->with('error','You have entered wrong password');
}else{
here you will write password update code
}
}