Getting 419 (unknown status) while submitting post ajax in laravel with the following code
url: '/forksnippet/saveforksnippets',
type: 'POST',
data:
'_token': '{{ csrf_token() }}',
$(this).serialize()
,
beforeSend: function(result){
$(".saveforksnippetbutton").attr("disabled", true);
$(".saveforksnippetbutton ").html('Auto saving...');
},
success: function(result) {
$(".saveforksnippetbutton ").html('Auto Saved');
}
});