laravel ajax post controller hit but no data code example
Example: laravel ajax post data to controller
$.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);
}
});