Im upgrading from laravel 7 to laravel 8 and Im trying to make a http request to a laravel API hosted locally. If I use http://localhost or http://127.0.0.1, the requests give a response. But if I use a http://192.168.x.x address, I get an error
Error: connect ECONNREFUSED. How do I use http://192.168.x.x ?
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
1- Identify your IP Address
2-Run your project
php artisan serve –host=192.168.1.10 –port=8000
3-Access your project via browser (on remote)
If your firewall is enabled, remote system might me blocked access.
– for this, you can either disable firewall completey on your local system
– or, enable certain port
In linux to allow a port
ufw enable 8000