How can I access my Laravel app from another PC?

前端 未结 6 1534
情话喂你
情话喂你 2020-12-14 01:14

I\'m trying to access my Laravel app from another PC in the same network using IP address but I can\'t get it to work by accessing 192.168.1.101:8000 in my browser.

6条回答
  •  -上瘾入骨i
    2020-12-14 01:40

    You can do it by using laravel's built in command php artisan serve.

    Follow the steps:

    1. Go to your project's root directory within command line.
    2. run php artisan serve

    If you still can't access port 8000 or it is already in use then run:

    php artisan serve --port 8383
    

    And it should listen on new port you provided. Also you can set other options for this command. Look for the help php artisan help serve.

提交回复
热议问题