0
Personal I am having problems with the CORS in my application Aravel 5.1, when I make a request via RESTLET it returns without problems. However, if the same request is made via AJAX it generates the Cors ERROR. What do I do? I’ve come across this before and managed to tidy up, but in this case I’m not getting.
This AJAX request of yours is leaving which domain?
– SylvioT
are two different domains, both are local.
– Fabricio Carneiro
Try adding the domain to CORS in the domain name https://medium.com/@petehouston/allow-Cors-in-Laravel-2b574c51d0c1 is in English I hope to help.
– SylvioT
puts already made it, didn’t work. thanks so much for the help.
– Fabricio Carneiro
Add the code to your question so we can help you.
– SylvioT
I uploaded the application to a domain. and placed the image.
– Fabricio Carneiro
You have thus added ->header(?Access-Control-Allow-Origin', ?*')?
– SylvioT
yes. no Cors.php public Function Handle($request, Closure $next) { header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS'); header('Access-Control-Allow-Headers: Content-Type, Accept, Authorization, X-Requested-With, Application'); Return $next($request); }
– Fabricio Carneiro