how to solve “no access control allow origin header is present on the” error in Laravel | CORS

4,661
0
Published 2018-04-12
This video is about fixing no access control allow origin header is present error in Laravel. This is a step-by-step guide to fix that error in a programmatic way. Here, we will use the concept of middleware to resolve the CORS error. The middleware will be called when a request coming from outside to the server.

Written tutorial: techpickups.com/a-quick-guide-to-fix-curl-error-60…

All Comments (9)
  • @vitalikostev299
    It works! ->header('Access-Control-Allow-Origin', '*') >header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS') ->header('Access-Control-Allow-Headers',' Origin, Content-Type, Accept, Authorization, X-Request-With') ->header('Access-Control-Allow-Credentials',' true');
  • @israrzaib4644
    Still not working and getting the same error message. may be there is a problem in my server configuration.
  • @466sunny
    I am getting the cors when using the live server api but with same api from local host works fine why not working with live api? Please help I am trying from 3 days still not solved please help
  • @lalitiwari1985
    I am not able to get access other api url. From this solutions i am only able get login url & the rest of the url which is in jwt auth. i am give same Cross origin error. Please give me solutions for this as soon as on urgent basis... Thanks