From 865bb1f30a0c4567522525fb0be9fd99bd796ecf Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 13 Mar 2021 17:56:37 +0100 Subject: Adding boilerplate code. --- resources/js/bootstrap.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'resources/js/bootstrap.js') diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index ffc0a2b..c3456b8 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -4,6 +4,8 @@ window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; window.Vue = require('vue'); +window.Vuex = require('vuex'); +Vue.use(Vuex); window.$ = window.jQuery = require('jquery'); window.Popper = require('popper.js'); -- cgit v1.2.3 From 2e570c76bda80def3e07ecc3478d8eb95905acbb Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 13 Mar 2021 23:57:41 +0100 Subject: Work on call-sign-filter component. --- resources/js/bootstrap.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'resources/js/bootstrap.js') diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index c3456b8..e5e0ab6 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -3,9 +3,13 @@ window._ = require('lodash'); window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; -window.Vue = require('vue'); -window.Vuex = require('vuex'); -Vue.use(Vuex); +let token = document.querySelector('meta[name="csrf-token"]'); + +if (token) { + window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; +} else { + console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); +} window.$ = window.jQuery = require('jquery'); window.Popper = require('popper.js'); -- cgit v1.2.3