$.ajax({
url: "/route/to",
type: 'POST',
beforeSend: function (request) {
return request.setRequestHeader('X-CSRF-Token', $("meta[name='csrf-token']").attr('content'));
},
success: data => {
console.log(data);
}
});