Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to Homestead which has multiple sites through mobile device?

I'm working on a website in Laravel which I run on Homestead 0.2.0 and I want to try to connect to it with my phone and tablet so I can test the website on those devices.

So I was googling around, trying to look how to do so. However, I can't find any articles that take multiple sites into account.

I read somewhere however that some routers don't allow WiFi connected devices to connect to directly connected devices.

I have my sites mapped like so:

sites:
    - map: app1.local
      to: /home/vagrant/projects/app1/public
    - map: app2.local
      to: /home/vagrant/projects/app2/public
    - map: app3.local
      to: /home/vagrant/projects/app3/public

How do I proceed?

like image 619
MisterBla Avatar asked Dec 26 '22 03:12

MisterBla


1 Answers

Solution

Add an entry 192.168.10.10 for the app you wanna test on your phone in the Homestead.yaml file and revision the Homestead machine. Then load ipaddress:8000 on your phone

Explanation

Upgrade to the latest Homestead, which maps *.app to 192.168.10.10

Then your hosts file has these entries:

192.168.10.10  app1.app app2.app app3.app

Let's say, your developing computer is using IP 192.168.0.102.

You can browse on your phone to

192.168.0.102:8000

to load/test app1.app (first in alphabetical order)

To test app3.app

Change your Homestead.yaml file from:

map: app3.app
 to: /home/vagrant/projects/app3/public

to:

map: app3.app
 to: /home/vagrant/projects/app3/public
map: 192.168.10.10
 to: /home/vagrant/projects/app3/public

Simply change the entry and revision the Homestead machine to test another app on your phone.

like image 51
Janghou Avatar answered Jan 30 '23 01:01

Janghou