did you include the csrf token?
<head> section of your layout
<meta name="csrf-token" content="{{ csrf_token() }}">
javascript
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi i want to send my form data to my controller page through ajax, But am getting "419 unknown status" error am not post my data. can anyone help me
This is my ajax calling, $.ajax({ url: '/invoices', method: 'POST', data: invoices, contentType: 'application/json', success: function(result) { alert("success"); }, error: function(error) { alert("Error in submitting data"); } });
and this is my web: Route::post('/invoices','InvoiceController@postInvoice');
Thank you..
Please or to participate in this conversation.