diff options
Diffstat (limited to 'resources/js/app.js')
| -rw-r--r-- | resources/js/app.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/resources/js/app.js b/resources/js/app.js new file mode 100644 index 0000000..f0fa127 --- /dev/null +++ b/resources/js/app.js @@ -0,0 +1,15 @@ +import htmx from 'htmx.org'; +import axios from 'axios'; +import jQuery from 'jquery'; + +// Expose globally so inline scripts and Blade templates can use them +window.htmx = htmx; +window.axios = axios; +window.$ = jQuery; +window.jQuery = jQuery; + +// Set axios CSRF header from meta tag +const token = document.querySelector('meta[name="csrf-token"]'); +if (token) { + axios.defaults.headers.common['X-CSRF-TOKEN'] = token.getAttribute('content'); +} |
