Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dev.khosromanesh's avatar

how include axios to blade template

hello guys ... i have web socket project using echo and axios in completely clear blade template i don't know how to include those library . when i use window.axios.post(something) i got error

Uncaught TypeError: Cannot read properties of undefined (reading 'post')
    at HTMLButtonElement.<anonymous>

could someone help me on this please ?

i ran one time the npm install --save-dev laravel-echo pusher-js command

0 likes
3 replies
Sinnbeck's avatar

Show your app.js and bootstrap.js files. And are you loading the app.js before the script?

dev.khosromanesh's avatar

actually there is no file in public folder with js/app.js structure , how i could generate that file ?

Please or to participate in this conversation.