Now, let's talk about Cross-Origin Resource Sharing (CORS). It seems like a very complicated topic. You can read about it in the developer.mozilla.org, but I will try to summarize it in the shortest possible way.
By default, in Laravel, you don't need to change anything, but you need to understand where to look if something goes wrong.
CORS isn't a Laravel or a PHP thing. It's how the browsers work. By default, if you try to open one resource from another domain resource, it's usually about web domains, you may run into a CORS error:
In Laravel, CORS settings are set in the config/cors.php
file; by default, it allows everything.
I have cloned the same Vue.js project into a different directory. So now, I have project.test
as a frontend and demo.test
as an API. I changed the API call to use...