Level 14
//header
<meta name="csrf-token" content="{{ csrf_token() }}" />
//script
$.ajax({
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.
I have an form in popup that is submitting by ajax. Its having the CSRF token but its still giving the TokenMismatchException error.
Post parameter screenshot : https://prnt.sc/ni7o33
Response screenshot : https://prnt.sc/ni7lga
Thank you in advance
Please or to participate in this conversation.