You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.7 KiB

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