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.







Test Your Local Developing Laravel Web Application From Phone Browser Without Any Software


Share On     Share On WhatsApp     Share On LinkedIn


Namaste! In this article you will learn how to test your locally developing Laravel web application from your phone browser without using any software.


Prerequisites


I hope you guys have working Laravel web application or fresh installation of your Laravel in computer / laptop.

NOTE: I have my blog stackcoder application for the sake of demonstration.

Step 1 - Test If Laravel Application Runs In Your Laptop


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.


Testing Local Laravel Developed Website | Virtual Host

Testing Local Laravel Developed Website | Virtual Host



Step 2 - Turn On Your Mobile Hotspot & Connect Your Laptop To It


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


Step 3 - Check IP Address Of Your Laptop


After connecting your laptop to mobile hotspot. Go to your terminal and type the following command


MACBOOK / UBUNTU


ifconfig 


Windows


ipconfig


You will see the ip address allocated to your laptop there, for example mine is shown in the following image


IP Address Of Laptop After Connecting To Phone Hotspot

IP Address Of Laptop After Connecting To Phone Hotspot



Step 4 - Start Your Laravel Built In Server From Step 3 IP Address


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.43 as that of my laptop got assigned after connecting to mobile hotspot in Step 3. And I want it to get connected with port 80 by default


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.


Step 5 - Testing In Your Mobile 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


Working In Phone Browser Image

Working In Phone Browser Image


Conclusion


Hope this article was helpful. You might be also interested in reading few of my other articles which will be really helpful for you




Author Image
AUTHOR

Channaveer Hakari

I am a full-stack developer working at WifiDabba India Pvt Ltd. I started this blog so that I can share my knowledge and enhance my skills with constant learning.

Never stop learning. If you stop learning, you stop growing