Commit 7b318939 authored by Taylor Otwell's avatar Taylor Otwell

Ship axios instead of vue-resource.

parent 100c102f
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"dev": "gulp watch" "dev": "gulp watch"
}, },
"devDependencies": { "devDependencies": {
"axios": "^0.15.2",
"bootstrap-sass": "^3.3.7", "bootstrap-sass": "^3.3.7",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"jquery": "^3.1.0", "jquery": "^3.1.0",
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
"laravel-elixir-vue-2": "^0.2.0", "laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.2", "laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2", "lodash": "^4.16.2",
"vue": "^2.0.1", "vue": "^2.0.1"
"vue-resource": "^1.0.3"
} }
} }
This diff is collapsed.
/** /**
* First we will load all of this project's JavaScript dependencies which * First we will load all of this project's JavaScript dependencies which
* include Vue and Vue Resource. This gives a great starting point for * includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel. * building robust, powerful web applications using Vue and Laravel.
*/ */
......
...@@ -17,19 +17,14 @@ require('bootstrap-sass'); ...@@ -17,19 +17,14 @@ require('bootstrap-sass');
*/ */
window.Vue = require('vue'); window.Vue = require('vue');
require('vue-resource');
/** /**
* We'll register a HTTP interceptor to attach the "CSRF" header to each of * We'll load the axios HTTP library which allows us to easily issue requests
* the outgoing requests issued by this application. The CSRF middleware * to our Laravel back-end. This library automatically handles sending the
* included with Laravel will automatically verify the header's value. * CSRF token as a header based on the value of the "XSRF" token cookie.
*/ */
Vue.http.interceptors.push((request, next) => { window.axios = require('axios');
request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken);
next();
});
/** /**
* Echo exposes an expressive API for subscribing to channels and listening * Echo exposes an expressive API for subscribing to channels and listening
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment