CSRF Token Not Found even if it's in meta tag and ajaxSetup
I want to ask a help. Why does console tell me "CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token" even if I have and $.ajaxSetup and Inspector shows the meta CSRF? With this problem, I can't do AJAX. Please help me
I had this problem,
finally, I found I was written something wrong in my view that causes the page HTML code totally print in an incorrect way. (@include out of @section)
check your page source to see your HTML code is correct.
Hello, all.
I have the same problem but though I've checked the structure of the blade view (the only one that has given me this problem in over 90 blade files that my project has so far) and I find nothing wrong with it.
I'm not using any include sentences and I have the meta tag mentioned before. I even tried rin4ik's suggestion to clear cache and composer dump-autoload the project but the ugly message is still there.
I have absolutely no idea why this could be happening.
Anybody has another suggestion? =/
Can you show the AJAX request and possibly the view as well? (And if the CSRF token is not in the view, then please show the include file that has it).
the browser won't lie, it's better to double check the page source of the rendered html to find out the csrf_token input and check whether is it included in your ajax submission properly.