That appears to be a javascript error rather than anything PHP/Laravel related
Dependency injection in API controllers
Hey!
I am trying to create an api using laravel that will serve into a react application. I have the api authentication working correctly (finally!) but I am running into an issue.
The way my app is set up, I have services that I am injecting into my controllers. These are provided and work fine on the web routes, but on my api routes I get "cannot call _ on undefined". It seems they aren't being provided.
Is this expected behavior on laravel, and is there something I can do to ensure my dependencies are there in my api controllers?
Ok! good news - I think this was a caching issue. It seems to have fixed itself by some miracle? (Which is wonderful! I couldn't imagine why the service provider logic would play any differently in api routes than it does in web routes :D )
Please or to participate in this conversation.