@@ -56,9 +56,17 @@ Vue.use(FileManager, {
5656 store, // required
5757
5858 // not required params
59- headers: {'Authorization': 'Bearer ...'}, // add header
60- // OR
61- headers: {'X-CSRF-TOKEN': 'token'}, // overwrite default header Axios
59+
60+ headers: {
61+ 'X-Requested-With': 'XMLHttpRequest',
62+ 'Authorization': 'Bearer ...'
63+ },
64+ // default headers example
65+ headers: {
66+ 'X-Requested-With': 'XMLHttpRequest',
67+ 'X-CSRF-TOKEN': 'set laravel csrf token here...'
68+ },
69+
6270 baseUrl: 'http://my_url:80/file-manager/', // overwrite base url Axios
6371 windowsConfig: 2,
6472 lang: 'de', // set language
@@ -73,12 +81,6 @@ Vue.use(FileManager, {
7381}
7482```
7583
76- In development mode you can change base url for application - add this param in your laravel .env file
77-
78- ```
79- MIX_LFM_BASE_URL=http://my-url.loc/file-manager/
80- ```
81-
8284Now vue component is registered and you can use it in your app
8385```
8486<file-manager></file-manager>
@@ -93,4 +95,14 @@ Don't forget add a csrf token to head block in your Laravel view and add bootstr
9395<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
9496```
9597
98+ You can use [ environment variables] ( https://laravel.com/docs/mix#environment-variables )
99+
100+ ```
101+ // set baseUrl
102+ MIX_LFM_BASE_URL=http://my-url.loc/file-manager/
103+
104+ // if you don't want to use csrf-token - you can off it
105+ MIX_LFM_CSRF_TOKEN=OFF
106+ ```
107+
96108Warning! Package use axios (Promise) - use babel-polyfill for ie11
0 commit comments