3

working with Laravel 5.7 as backend and Vue.js as frontend. so, I need send http request fron Vue to Laravel backend. so, I used Laravel CORS package to using github link as following https://github.com/barryvdh/laravel-cors but it is not sucess and (not pass data to table fron vue). and my console error is `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8000/api/addItem. (Reason: CORS request did not succeed).

how can fix this error?`

1 Answer 1

3

It is only for localhost & in production if you use https then this issue will not raise any more. However for local test you can open chrome browser in disabled security mode. Details about how to do

Access-Control-Allow-Origin (Laravel & Vue)

Sign up to request clarification or add additional context in comments.

2 Comments

how can I do this for firefox?
There are some articles available online to disable web security in firefox but these not worked. You can check in IE11 there should be no issue as web security not implemented like chrome there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.