Am I missing something? I didn't change anything in app.js, and it worked when there was no @yield and @include, but it doesn't work now even when i comment it out
in your master page or somewhere else which is public to all document. but better place is master page add this
<script>
$csrfToken={{csrf_token()}}
</script>
//then in all java scripts or ajax or jquery request any client scripting you wanted that token just take it like this.
var token = csrfToken;
This literally started happening to me today, out of the blue, on the same project I've been working on for months. I have no idea what I changed. However swapping from:
document.head.querySelector("[name=csrf-token]").content
to
document.querySelector("meta[name=csrf-token]").content
...worked.
I'm confused.