Using mobile device to access to Laravel local environment

Other than setting up virtual host on your development server by Apache or Nginx configuration ( which you can find the guide here ) Sometimes you should find need to access to your local environment by mobile device. The virtual host no longer provide you such setup.

Using Laravel artisan and PHP built-in server

Simply running 
php artisan serve --host
This command will set up a PHP built-in server and will listening to the default port of 8000 to avoid any conflict, so if your ip address is, you can access your local environment via mobile device by

However if you wish to listen to the Http default port of 80, you can also define as by adding 1 parameter into it, still you need to make sure no other server is running on that port.
php artisan serve --host --port 80
Now you can access by simply typing in the ip address of :

*Note: If you use MacOS, you can find out your ip address by accessing System Preferences / Network and look at the wifi ip address.
If you liked this article

Let's subscribe the updates of Scuti!
Share on Google Plus

About Anonymous

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment


Post a Comment