Passed
Push — bugfix/job_translation_fields ( dcec43...2ad85b )
by Tristan
14:10
created

resources/assets/js/bootstrap.js   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 17
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0
cc 1
nc 2
mnd 1
bc 2
fnc 0
bpm 0
cpm 0
noi 0
1
// window._ = require('lodash');
2
3
/**
4
 * We'll load jQuery and the Bootstrap jQuery plugin which provides support
5
 * for JavaScript based Bootstrap features such as modals and tabs. This
6
 * code may be modified to fit the specific needs of your application.
7
 */
8
9
10
// try {
11
//     window.$ = window.jQuery = require('jquery');
12
//
13
//     require('bootstrap-sass');
14
// } catch (e) {}
15
16
/**
17
 * We'll load the axios HTTP library which allows us to easily issue requests
18
 * to our Laravel back-end. This library automatically handles sending the
19
 * CSRF token as a header based on the value of the "XSRF" token cookie.
20
 */
21
22
window.axios = require('axios');
23
24
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
25
26
/**
27
 * Next we will register the CSRF Token as a common header with Axios so that
28
 * all outgoing HTTP requests automatically have it attached. This is just
29
 * a simple convenience so we don't have to attach every token manually.
30
 */
31
32
let token = document.head.querySelector('meta[name="csrf-token"]');
33
34
if (token) {
35
    window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
36
} else {
37
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
38
}
39
40
/**
41
 * Echo exposes an expressive API for subscribing to channels and listening
42
 * for events that are broadcast by Laravel. Echo and event broadcasting
43
 * allows your team to easily build robust real-time web applications.
44
 */
45
46
// import Echo from 'laravel-echo'
47
48
// window.Pusher = require('pusher-js');
49
50
// window.Echo = new Echo({
51
//     broadcaster: 'pusher',
52
//     key: 'your-pusher-key',
53
//     cluster: 'mt1',
54
//     encrypted: true
55
// });
56