fruitcake / laravel-cors

Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
MIT License
6.27k stars 614 forks source link

CORS is not working while server tries to send notification. #465

Open jwn25 opened 4 years ago

jwn25 commented 4 years ago

Hi, I am currently encountering errors on CORS. I used laravel as my server and using Vue.js for my dashboard. All the API's are working great so far. But whenever I try to save userdata and notify user using laravel notification I am getting CORS issue.

My Route: Screenshot from 2020-05-26 23-31-10

Function in Controller: Screenshot from 2020-05-26 23-31-00

Error On Vue.js part: Screenshot from 2020-05-26 23-32-13

NOTE: When I try to remove the line which is sending notification it is working fine.

barryvdh commented 4 years ago

Do you get an error or something?

jwn25 commented 4 years ago

hello @barryvdh thank you for your response.

The code up to insert data is executing. (I can see data on my database). But while code flow reaches up to the line where I am trying to send notification I got an error on the console like "URL from origin has been blocked by CORS'

And on the network tab there was no response from the server at all.

kieuminhcanh commented 4 years ago

For somebody who use Windows 10 Maybe fixed.

This is a intel graphics card software related issue on windows 10.

How to fix:

In windows, go to: Start menu Type: Services: Find the service called: "Intel(R) Graphics Command Center Service" Right click > Properties > Startup type = Disabled This fixed the problem for me.. :-)

barryvdh commented 4 years ago

Can you check your logs? Or a POSTMAN request?

Suryadeep-bhujel commented 4 years ago

I am getting same issue on my new project. I am using ubuntu 18.04 os on my machine, Using Laravel 6

I added package as per given instructions. But getting 'Access-Control-Allow-Origin' issue.

barryvdh commented 4 years ago

Please create your own issue and follow the instructions.

Suryadeep-bhujel commented 4 years ago

Please create your own issue and follow the instructions.

Thank you so much.