Good content takes time and effort to come up with.
Please consider supporting us by just disabling your AD BLOCKER and reloading this page again.
Namaste! In this article you will learn how to test your locally developing
Laravel web application from your phone browser without using any software.
I hope you guys have working
Laravel web application or fresh installation of your
Laravel in computer / laptop.
NOTE: I have my blog
stackcoderapplication for the sake of demonstration.
I have developed the
stackcoder Laravel web application in my local laptop and have created the virtual hosts which can be accessed with
stackcoder.co:8888 from my laptop browser.
Now turn on your mobile hotspot and connect your laptop to it. I use ( Android )Redmi Note phone and you can find the hotspot enabling option with the following, this will mostly remain same for other devices too
i. Settings -> Portable Hotspot ->Portable Hotspot ( Turn On By Clicking Switch Button )
ii. Click On Setup Portable Hotspot -> Set SSID & PASSWORD
Your all set to share & connect your hotspot with SSID & PASSWORD
After connecting your laptop to mobile hotspot. Go to your terminal and type the following command
MACBOOK / UBUNTU
You will see the ip address allocated to your laptop there, for example mine is shown in the following image
Now go to your
Laravel application folder in the terminal and run the following command to turn on the built in server.
sudo php artisan serve --host 192.168.43.43 --port 80
Here we are using the same IP Address
192.168.43.43as that of my laptop got assigned after connecting to mobile hotspot in Step 3. And I want it to get connected with port
You will get the following success output after running the above command
sudo php artisan serve --host 192.168.43.43 --port 80 #ouput Password: Laravel development server started: http://192.168.43.43:80
Now your application is ready to be access with
http://192.168.43.43:80 URL. No need to add port 80 as its the default port for
HTTP. You can test the same in your laptop before going to your phone browser.
Now go to your phone browser and open the URL http://192.168.43.43 you will be able to see the application developed as shown in the following image
Hope this article was helpful. You might be also interested in reading few of my other articles which will be really helpful for you
Happy Coding :)