A solution is marked in that post to use laravel-cors. I've also used it before and it worked in my case.
If you happen to know angularjs or something similar, try using that instead of laravel for front end, but keep in mind that web crawlers can have problems indexing those pages.
pogachar said:
A solution is marked in that post to use laravel-cors. I've also used it before and it worked in my case.
If you happen to know angularjs or something similar, try using that instead of laravel for front end, but keep in mind that web crawlers can have problems indexing those pages.
You have no idea how much ive been struggling with this CORS problem... I use Firefox for my dev but decided to open Chrome and see if the problem I was having was not maybe a browser issue.
Firefox's handling of CORS errors in 1 word: sucks. So if you're having the same problems as ive been having for days rather use Chrome for any CORS dev as it has WAY more descriptive error handling and I actually managed to fix my problem.
I had my header declared "twice" in all my fiddling so there was some kinda of issue there + I didnt switch supportsCredentials to true on the laravel-cors package config and I was setting withCredentials: true on my AJAX request... Its highly unlikely I would have figured out those problems without some kinda of descriptive error. Thanks Firefox/Firebug for wasting days of my life! Altho I will still continue dev in Firefox ill check console errors on Chrome on a regular basis...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community