diff --git a/bootstrap/app.php b/bootstrap/app.php index d654276..ae59fec 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -12,7 +12,7 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware) { - // + $middleware->statefulApi(); }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 5f1390b..530b129 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -1,4 +1,8 @@ import axios from 'axios'; + window.axios = axios; +window.axios.defaults.baseURL = import.meta.env.VITE_APP_URL; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; +window.axios.defaults.headers.common['X-CSRF-Token'] = document.querySelector('meta[name="csrf-token"]').getAttribute('content'); +window.axios.defaults.withCredentials = true;