1 window._ = require('lodash');
10 * We'll load the axios HTTP library which allows us to easily issue requests
11 * to our Laravel back-end. This library automatically handles sending the
12 * CSRF token as a header based on the value of the "XSRF" token cookie.
15 window.axios = require('axios');
17 window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
20 window.axios.defaults.paramsSerializer = p => qs.stringify(p, { arrayFormat: 'brackets' });
23 * Echo exposes an expressive API for subscribing to channels and listening
24 * for events that are broadcast by Laravel. Echo and event broadcasting
25 * allows your team to easily build robust real-time web applications.
28 import Echo from 'laravel-echo';
30 window.Pusher = require('pusher-js');
32 window.Echo = new Echo({
33 broadcaster: 'pusher',
34 key: process.env.MIX_PUSHER_APP_KEY,
35 cluster: process.env.MIX_PUSHER_APP_CLUSTER,
36 wsHost: window.location.hostname,
37 wsPort: window.location.port,
40 enabledTransports: ['wss', 'ws'],