Commit 5b8401e1 authored by Arjan Weurding's avatar Arjan Weurding Committed by GitHub

Make window.Laravel.csrfToken unneccesarry

I don't like the fact we have to add 
```
<script>
        window.Laravel = {!! json_encode([
            'csrfToken' => csrf_token(),
        ]) !!};
</script>
```
To have it working, when the docs suggest adding only the meta tag. This will get the token from the meta tag.
parent ba5c2945
...@@ -21,7 +21,7 @@ try { ...@@ -21,7 +21,7 @@ try {
window.axios = require('axios'); window.axios = require('axios');
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken; window.axios.defaults.headers.common['X-CSRF-TOKEN'] = document.head.querySelector('meta[name="csrf-token"]').content;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment