Access to XMLHttpRequest at 'http://localhost:8000/api/objectives' from origin 'http://localhost:4200' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.
Access to XMLHttpRequest at 'http://localhost:8000/api/objectives' from origin 'http://localhost:4200' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.
Head over to the cors.php in config folder and change this 'allowed_origins_patterns' => [], to 'allowed_origins_patterns' => ['*'],
First solution is to use this library https://github.com/fruitcake/laravel-cors
second one is adding header('Access-Control-Allow-Origin: *'); to your public/index.php that may fix the problem
I ran into similar issues. In my case, I fixed it by removing
Header set Access-Control-Allow-Origin "*"
from my .htaccess file.