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