You have two hosts? localhost and localhost:3000 ? They are seen as different servers
Jun 15, 2022
10
Level 8
Why don't the docs mention anything about the paths array in cors.php?
I feel like I'm doing something wrong since the only way I managed to make my Vue app successfully send requests to the Laravel backend is after adding the needed routes (/test in my example) to the paths array in cors.php:
'paths' => ['api/*', 'sanctum/csrf-cookie', '/test'],
Before I added it, I was getting this error message on the frontend:
Access to XMLHttpRequest at 'http://localhost/test' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Is there a reason it's not mentioned in the docs? Or I am doing something wrong?
Ty!
Please or to participate in this conversation.