Skip to content

Commit 7b31893

Browse files
committed
Ship axios instead of vue-resource.
1 parent 100c102 commit 7b31893

File tree

4 files changed

+16
-22
lines changed

4 files changed

+16
-22
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"dev": "gulp watch"
66
},
77
"devDependencies": {
8+
"axios": "^0.15.2",
89
"bootstrap-sass": "^3.3.7",
910
"gulp": "^3.9.1",
1011
"jquery": "^3.1.0",
1112
"laravel-elixir": "^6.0.0-11",
1213
"laravel-elixir-vue-2": "^0.2.0",
1314
"laravel-elixir-webpack-official": "^1.0.2",
1415
"lodash": "^4.16.2",
15-
"vue": "^2.0.1",
16-
"vue-resource": "^1.0.3"
16+
"vue": "^2.0.1"
1717
}
1818
}

public/js/app.js

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/assets/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
33
* First we will load all of this project's JavaScript dependencies which
4-
* include Vue and Vue Resource. This gives a great starting point for
4+
* includes Vue and other libraries. It is a great starting point when
55
* building robust, powerful web applications using Vue and Laravel.
66
*/
77

resources/assets/js/bootstrap.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@ require('bootstrap-sass');
1717
*/
1818

1919
window.Vue = require('vue');
20-
require('vue-resource');
2120

2221
/**
23-
* We'll register a HTTP interceptor to attach the "CSRF" header to each of
24-
* the outgoing requests issued by this application. The CSRF middleware
25-
* included with Laravel will automatically verify the header's value.
22+
* We'll load the axios HTTP library which allows us to easily issue requests
23+
* to our Laravel back-end. This library automatically handles sending the
24+
* CSRF token as a header based on the value of the "XSRF" token cookie.
2625
*/
2726

28-
Vue.http.interceptors.push((request, next) => {
29-
request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken);
30-
31-
next();
32-
});
27+
window.axios = require('axios');
3328

3429
/**
3530
* Echo exposes an expressive API for subscribing to channels and listening

0 commit comments

Comments
 (0)