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

hjortur17's avatar

CORS

I'm struggling with this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://vasp.siminn.is/smap/push?msisdn=8425759&T=Hae. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

I have tried to make the Cors middleware but that didn't work. Any ideas?

0 likes
1 reply
garethredfern's avatar
Level 10

Are you using Laravel 7? If you are then it comes with a package to help manage CORS. If you are not you could install it yourself. https://github.com/fruitcake/laravel-cors

CORS can be hard work to debug but from what I can see from your error, you are missing the header Access-Control-Allow-Origin, the package I have mentioned will add that for you.

Please or to participate in this conversation.