Access to Laravel 5 app locally from an external device

后端 未结 6 599
忘掉有多难
忘掉有多难 2020-11-30 20:10

I\'ve looked for a solution in the web, but I\'ve not found a solution yet. I need to access to my Laravel 5 app from my iPhone, but I\'m in develop, so I don\'t want to pub

6条回答
  •  無奈伤痛
    2020-11-30 21:10

    Its simple, first you have to run the server

    php artisan serve --host 0.0.0.0
    

    Then you need to know what`s your IP address, run this command to get IP:

    In windows:

    ipconfig
    

    In Linux:

    hostname -I
    

    For example, my IP is: 192.168.1.68

    Once you get your IP, then you have to go to this address on your mobile. Like:

    192.168.1.68:8000
    

    And that's it.

提交回复
热议问题