Skip to content

Commit 3f19733

Browse files
committed
bootstrap vue in app.js
1 parent fd569a3 commit 3f19733

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
"gulp": "^3.9.1",
1010
"laravel-elixir": "^6.0.0-9",
1111
"laravel-elixir-webpack-official": "^1.0.2"
12+
},
13+
"dependencies": {
14+
"js-cookie": "^2.1.2",
15+
"vue": "^1.0.26",
16+
"vue-resource": "^0.9.3"
1217
}
1318
}

resources/assets/js/app.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11

2-
//
2+
window.Cookies = require('js-cookie');
3+
4+
/**
5+
* Vue.js
6+
*
7+
* Vue is a modern JavaScript for building interactive web interfaces using
8+
* reacting data binding and reusable components. Vue's API is clean and
9+
* simple, leaving you to focus only on building your next great idea.
10+
*/
11+
window.Vue = require('vue');
12+
13+
require('vue-resource');
14+
15+
/**
16+
* The XSRF Header
17+
*
18+
* We'll register a HTTP interceptor to attach the "XSRF" header to each of
19+
* the outgoing requests issued by this application. The CSRF middleware
20+
* included with Laravel will automatically verify the header's value.
21+
*/
22+
Vue.http.interceptors.push(function (request, next) {
23+
request.headers['X-XSRF-TOKEN'] = Cookies.get('XSRF-TOKEN');
24+
25+
next();
26+
});

0 commit comments

Comments
 (0)