loading...

re: Building Vue.js Client SPA Token-Based Authentication with Laravel Sanctum VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi! Nice tutorial! How to use axios in other compoents for further api requests?
 

That's a good question, Balázs!

You can add in main.js:

Vue.prototype.$axios = axios

After that in components you can write:

$axios.get('/items')
  .then(function (response) {
    console.log(response)
  })
code of conduct - report abuse