Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Shamp's avatar
Level 1

console cors error in laravel

i got this unexpected err in my console in laravel project : "Access to XMLHttpRequest at 'https://bff-api-gw.dsers.com/account-user-bff/v1/stores/user/list' from origin 'http://127.0.0.1:8000' 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." please anyone help

0 likes
12 replies
vincent15000's avatar

Please share the code you are using to send the request to the endpoint ?

vincent15000's avatar

@Shamp You don't know from where ? Who has written the code ?

Same question, show the code you are using to send the ajax request.

Typically if you have a problem with Access-Control-Allow-Origin, this means that you attemp to access an API with a source code from a web adress not allowed by the API.

If you are using a third party API, perhaps you need to allow your API consumer website address.

Shamp's avatar
Level 1

@vincent15000 i edit the main route '/' and let the controller view a page with h1 only without any javascript files rendered the console still give the main ajax cors error ? !!!

Shamp's avatar
Level 1

Thanks all it solved its just cache in the browser

1 like
vincent15000's avatar

@Shamp You can notice that if you don't answer any of our questions (give code, which console, ...), it's impossible for us to help you.

Please or to participate in this conversation.