0👍
You need to respond with Access-Control-Allow-Origin
header when accessing backend from differend domain. In this example the value of Access-Control-Allow-Origin
must be http://localhost:8000
.
Adding header to your response is quite easy in laravel: https://laravel.com/docs/5.7/responses#attaching-headers-to-responses
You can also use this library: https://github.com/barryvdh/laravel-cors
Source:stackexchange.com