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 stackcoder
application 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
ifconfig
Windows
ipconfig
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 Address192.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 port80
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.
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
Debugging Laravel Queue Email Issues
Redirect www to a non-www Website Or Vice Versa
Securely SSH Your Server & Push Files With FileZilla
Sass or SCSS @mixin vs @extends vs Placeholder (%)
Factories To Speed Up Test-Driven Development In Laravel
Google, Twitter, GitHub, Facebook & Many Other Social Generic Logins With PHP Laravel Socialite
Custom Validation Rules In PHP Laravel (Using Artisan Command)
Global Data In All Laravel Blade Pages
Route Model Binding In Laravel & Change Default Column id To Another Column
PHP file_put_contents failed to open stream: Permission denied
Integrate Google Translate Into Your Website
Use Different PHP Versions In Ubuntu / Linux
What Is HTTP? Different HTTP Methods And Status Codes Explained With Examples