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

后端 未结 1 1885
春和景丽
春和景丽 2021-01-14 03:03

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.

1条回答
  •  臣服心动
    2021-01-14 03:51

    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.

    0 讨论(0)
提交回复
热议问题