Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nyahera's avatar

React App on mobile devices not fetching data from laravel 11 api on main domain in my cpanel but works just fine on subdomain.

Am having an issue with my react app trying to fetch data from laravel 11 backend, everything seems to work fine except on production and on mobile device, when I upload the project on my main domain in cpanel I cant fetch data from database when using mobile device, but when I upload the same project to a subdomain everything works fine on my mobile device. what could be the issue. on desktop it works just fine on both main domain and subdomain.

0 likes
2 replies
martinbean's avatar

@nyahera Define “can’t fetch data”. What happens? Do you get an error message?

No one can help unless you give context and details, as we can’t see your code nor your screen.

nyahera's avatar

@martinbean I am trying to display items in my frontend app build with react from database build in laravel, when i deploy the project in subdomain am able to display the items very well on mobile device, the same project deployed to main domain does not show anything, no errors but static files are showing just fine.

Please or to participate in this conversation.