Make axios compatible with Request::ajax()

It seems the library doesn't send the `X-Requested-With: XMLHttpRequest` header by default, if it's not present `$request->ajax()` always returns false.
This commit is contained in:
Martin Bastien 2016-12-08 11:45:33 -05:00 committed by GitHub
parent 61b157f809
commit f2981650a1
1 changed files with 1 additions and 0 deletions

View File

@ -25,6 +25,7 @@ window.Vue = require('vue');
*/
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
* Echo exposes an expressive API for subscribing to channels and listening