When you’re building a web app in Laravel, testing how it looks and behaves on a mobile device is a must. You want to see how your buttons feel, how your layout responds, and whether that slick animation actually works on touch.
But here’s the thing: you don’t need to deploy your app online to test it on your phone.
You can access your Laravel project running on your local machine directly from your mobile browser, as long as both are connected to the same Wi-Fi.
Let’s break it down step by step. 🚀
Why You’d Want This Setup
When you’re in the middle of development, it’s much faster to test directly on your phone instead of deploying or using emulators.
This approach helps you:
- Check responsive layouts in real devices.
- Test touch gestures and scroll behavior.
- Debug mobile-only bugs without pushing code anywhere.
Step 1: Connect Both Devices to the Same Wi-Fi
Make sure your computer/laptop (where Laravel is running) and your mobile phone are connected to the same Wi-Fi network.
This is essential; both devices need to be on the same local network to communicate with each other.
Step 2: Find Your Computer’s Local IP Address
Your mobile device will use your computer’s local IP address to reach the Laravel app.
On Windows
Open Command Prompt and type:
ipconfig
Look for the line that says something like:
IPv4 Address. . . . . . . . . . . : 192.168.x.x
On macOS / Linux
Open Terminal and run:
ifconfig
Or
ip addr show
Find the IP under your active network interface; usually en0 (Wi-Fi) or wlan0.
Step 3: Start the Laravel Development Server
In your Laravel project directory, run:
php artisan serve --host=0.0.0.0 --port=8000
Here’s what this does:
- --host=0.0.0.0 tells Laravel to listen on all network interfaces (not just localhost). 
- --port=8000 specifies which port to use — you can change it if needed. 
You’ll see something like:
Starting Laravel development server: http://0.0.0.0:8000
[Mon Oct 27 10:00:00 2025] PHP 8.2 Development Server (http://0.0.0.0:8000) started
Step 4: Open the App on Your Mobile Browser
Now open a browser (Chrome, Safari, or Firefox) on your phone and type:
http://192.168.x.x:8000
👉 Replace 192.168.x.x with your computer’s IP address from Step 2.
If everything’s set up correctly, your Laravel app should load on your mobile screen just like it does on a desktop.
  
  
  Bonus Tip: Update Your APP_URL Callback URLs
APP_URL=http://192.168.x.x:8000
If your app uses OAuth, API callbacks, or any URL-based configuration (like with Google, GitHub, or social logins), update those callback URLs to match the new local address, too.
Final Thoughts
That’s it. You’ve just made your local Laravel app accessible from your phone.
It’s one of those simple but powerful tricks that make testing real and quick.
Whether you’re checking your UI on multiple devices, showing a demo to a teammate, or tweaking responsive layouts, this setup saves time and effort.
Happy building! 💻📱✨
 
 
              
 
    
Top comments (0)