3 years ago

Laravel 5.4 and Axios

Posted 3 years ago by brunowerneck

I've done a fresh install of the latest development version of Laravel 5.4 and I'm trying to "consume my own API", following the guide in the Laravel 5.3 documentation for installing Passport.

Whenever I try to make an ajax request to the api, like /api/user, I get the Unauthorized error, even though I followed all steps in the documentation.

In a regular 5.3.* installation, using Vue-Resource, it works like a breeze, but it is not working in Axios.

I can, however, create routes in the web.php routes file and query them using Axios with no further problems.

Does anyone have any idea of how to consume our own API using the API middleware and Axios?

Please sign in or create an account to participate in this conversation.