Laravel 9 API works with localhost but not with device IP
I have my Laravel 9 installed inside xampp/htdocs. It works fine when I use API URL with localhost but it throws 404 when I use my device's IP address. http://localhost/myapp/public/api/users It works fine and returns me all the users but http://192.168.254.6/myapp/public/api/users gives me 404. Due to this I am not able to access the app from local network too. I simply tested the case with only one php file test.php and http://192.168.254.6/testapp/test.php works fine. I logged the incoming requests in index.php inside Laravel public directory and I found that Laravel is receiving the requests but when I tried to log the requests inside a controller and even inside a middleware, I got nothing. What might be the reason for it?