Created
January 15, 2019 12:05
-
-
Save robozavri/45ac28bcaa595ff56c28da9afdfad983 to your computer and use it in GitHub Desktop.
laravel Access-Control-Allow-Origin from origin 'http://localhost:8080' has been blocked by CORS policy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The simple answer is to set the Access-Control-Allow-Origin header to localhost or *. Here's how I usually do it: | |
Add the following code to bootstrap/app.php: | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods: *'); | |
header('Access-Control-Allow-Headers: *'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment