I have two laravel server running in localhost. One in port 8000 and another in port 8080. I'm trying to get data into port 8080 laravel server in the blade with the jquery ajax from port 8000 laravel where I have setup api. But Im getting this error in console:
Access to XMLHttpRequest at 'http://localhost:8000/api/v3.3/movies?draw=' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I have tried to hit the api direct from url of browser and I do get data in json format.
I have tried to use 'barryvdh/laravel-cors' package but same error persist. I could use guzzle for the api call to another server through controller but I find direct request from jquery ajax in blade will be more approval for the project Im in.