You can use beforeSend, as shown below, in your ajax call for put, post methods. $.ajax({ type: 'POST', beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))}, url: your url, data: data });
leena source share