Home > front end >  How to host my laravel 9 project on my computer to be accessible to other computers or my android ap
How to host my laravel 9 project on my computer to be accessible to other computers or my android ap

Time:10-28

Good day, can I please get assistance.

I was trying host my Laravel project on my computer but I cannot quite get it right...

I tried running this command "php artisan serve --host=192.168.1.94" to host my project to be accessible to my android app but it's not working because I usually you "php -S 127.0.0.1:8000 -t public/" to start the project. How do I then host using the second one or what solution is there for it?? Thanks in advance!

CodePudding user response:

If you want to acces your laravel API from another device, you have to put it up on a server, otherwise this will not be possible.

you can put your laravel API on free webhosts like 000webhost.

CodePudding user response:

If your device connects to the same network, you can run.

php artisan serve --port=80 --host=192.168.1.94

and in the Android app, the server is 192.168.1.94.

  • Related