Merge branch 'feature/vuejs' into feature/move-to-webpack
This commit is contained in:
commit
cbdf4d4e1a
16 changed files with 270 additions and 232 deletions
19
resources/assets/scripts/helpers/axios.js
Normal file
19
resources/assets/scripts/helpers/axios.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
let axios = require('axios');
|
||||
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
axios.defaults.headers.common['Accept'] = 'application/json';
|
||||
|
||||
if (typeof phpdebugbar !== 'undefined') {
|
||||
axios.interceptors.response.use(function (response) {
|
||||
phpdebugbar.ajaxHandler.handle(response.request);
|
||||
|
||||
return response;
|
||||
});
|
||||
}
|
||||
|
||||
export default axios;
|
Loading…
Add table
Add a link
Reference in a new issue