File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 9
9
"gulp" : " ^3.9.1" ,
10
10
"laravel-elixir" : " ^6.0.0-9" ,
11
11
"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"
12
17
}
13
18
}
Original file line number Diff line number Diff line change 1
1
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments