In laravel I want to check if user enter current password than check with that password which is store in database in that user data. If correct than continue otherwise give message Password is incorrect.
I am new in laravel so not getting exact idea for this.
Thanks in advance.
$('#pwd').blur(function(){
var oldpwd=$('#pwd').val();
var uid = $('#id').val();
console.log(uid);
if(oldpwd != "")
{
$.ajax({
url : "{{ url/profile/checkOldPwd}}",
data : { oldpwd:oldpwd , uid:uid },
type : "POST",
success : function(data) {
if(data == 0){
$("#msg-old").show();
$("#msg-old").html("Password is Incorrect!");
$("#pwd").val("");
$("#pwd").focus();
}
else
{
$("#msg-old").hide();
$("#msg-old").html("");
}
}
});
}
});