aboutsummaryrefslogtreecommitdiff
path: root/resources/js/bootstrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/bootstrap.js')
-rw-r--r--resources/js/bootstrap.js10
1 files changed, 7 insertions, 3 deletions
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');