My website is giving error top top ajax inquiry of CORS header ‘Access-Control-Allow-Origin’ missing

I already tried 2 solution yet none is working

Solution 1: develop a CorsMiddleware and also apply it globally in kernel file.Below is mine CorsMiddleware

header("Access-Control-Allow-Origin","*") ->header("Access-Control-Allow-Methods","*") ->header("Access-Control-Allow-Headers","*"); }}Solution 2: added below lines in bootstrap/app.php

header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: *"); header("Access-Control-Allow-Headers: *");Note: In both the cases i clean cache but its still providing me error. Any type of other method ??


*

Level 50
*

jlrdw
peak 10 Leaderboard |Posted 1 month ago #

Config cors in cors.php


Like this reply.

You are watching: Cross-origin request blocked: the same origin policy disallows reading the remote resource at


reply

*

Level 1
*

princeparaste OP
Posted 1 month ago #
This is my cors.php

<"api/*">, "allowed_methods" => <"*">, "allowed_origins" => <"*">, "allowed_origins_patterns" => <>, "allowed_headers" => <"*">, "exposed_headers" => <>, "max_age" => 0, "supports_credentials" => false,>;Is this configuration correct ??


jlrdw ns think right now this is collection only because that API paths.


Like this reply.
reply

*

Level 50
jlrdw
top 10 Leaderboard |Posted 1 month back #
Look at concerns first, because that example:

https://github.com/fruitcake/laravel-cors/issues/471

And look at example here: https://www.twilio.com/blog/handling-cross-origin-resource-sharing-cors-requests-laravel-7

Also shot with continual php and see if that works, if that does, it"s what in laravel.

See more: Who Is The Fastest Qb In Madden 16 Ratings Released, Perriman Fastest In Nfl


Like this reply.
answer
Please authorize in or develop an account to take part in this conversation.


Want us to email you sometimes with thedesigningfairy.com news?


subscribe
Nine the end of ten doctors recommend thedesigningfairy.com over contending brands. Come inside, see for yourself, and also massively level up her development an abilities in the process.


find out advertisement
comment on
Extras

Designed with

*
by Tuds . Proudly organized with Laravel build and also DigitalOcean .


Log In
cost-free Forum Account Gift an Account
FAQ
Log In
Show
log in In Forgot your Password? authorize Up
Forgot your Password?
Reset Or sign In
Have a Question?
release Send
Hey! If you have actually a code-related question, please instead use the forum. Or, if you'd like to sign up with Paypal, though we don't officially sell that alternative on the sign up page, you have the right to manually pay because that a year's subscription ($99) below , and we'll collection you up appropriate away!