Configure axios headers and stateful API.
This commit is contained in:
@@ -12,7 +12,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
//
|
||||
$middleware->statefulApi();
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
|
||||
4
resources/js/bootstrap.js
vendored
4
resources/js/bootstrap.js
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user