From 7d152a7b54eb8cf2c158e3746ea017a14fd5c46e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 8 Nov 2018 22:01:59 -0700 Subject: [PATCH] Update bootstrap.js --- resources/assets/js/bootstrap.js | 9 +++++++++ resources/assets/js/components.js | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index 891e8037..5ce928e6 100644 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -5,3 +5,12 @@ window.$ = window.jQuery = require('jquery'); require('bootstrap'); window.typeahead = require('./lib/typeahead'); window.Bloodhound = require('./lib/bloodhound'); +window.axios = require('axios'); +window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; + +let token = document.head.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'); +} diff --git a/resources/assets/js/components.js b/resources/assets/js/components.js index 4d71d98b..69b70b06 100644 --- a/resources/assets/js/components.js +++ b/resources/assets/js/components.js @@ -4,17 +4,8 @@ Vue.use(BootstrapVue); window.InfiniteScroll = require('infinite-scroll'); window.filesize = require('filesize'); -window.axios = require('axios'); -window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; import swal from 'sweetalert'; -let token = document.head.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'); -} - require('./components/localstorage'); require('./components/likebutton'); require('./components/commentform');