Error 404 when trying to connect to Laravel Passport API through VUE.JS
Greetings,
I have a little personal project I 've been working on that was built on top Laravel, it occured to me to migrate its front end to mainly Vue Js and decided to make my controllers available through an API for learning purposes.
I followed step by step the official guide to install passport and watched the 2016 Laracast video that shows how to connect to an APi with VueJs but it isnt working for me, when I hit my endpoint it throws a 404 Error.
Any idea of what is happening?
In the link below you will see screenshots of my code.
Yeah, everything always looked okay in route:list. Even cleared all cached files and double checked everything but it just wont work with Laravel Passport enabled.
I looked a the code that you provided. I didn't see anything that looked off. I did notice that your using http basic auth. What http server are you using? It's mentioned here that you could need to update the .httaccess file. https://laravel.com/docs/master/authentication#http-basic-authentication
Routes defined in the routes/api.php file are nested within a route group by the RouteServiceProvider. Within this group, the /api URI prefix is automatically applied so you do not need to manually apply it to every route in the file. You may modify the prefix and other route group options by modifying your RouteServiceProvider class.
You might want to try accessing /api/expenses/historic if the route was added inside api.php routes file.