Level 25
Put it in main.js.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to send the correct CORS headers one very request when using Axios. In Laravel's docs it says that I need to set axios.defaults.withCredentials = true; in resources/js/bootstrap.js. But right now I have two separate apps: One Vue CLI and one Laravel.
So there is no resources/js/bootstrap.js.
In a Vue CLI app (npm init vue@latest), where should I set axios.defaults.withCredentials = true;?
Put it in main.js.
Please or to participate in this conversation.