· NGSRV Team

How to share a Laravel dev server online

You finished a feature branch and someone off your machine needs to click through it. Deploying a staging build works, but it is slow. Running php artisan serve and tunneling it is faster.

php artisan serve binds to 8000 by default. Match that port in ngsrv http 8000.

Steps

# 1. Start Laravel
php artisan serve

# 2. In another terminal, tunnel the port
ngsrv http 8000

Most setups work without extra config.

Reserve a URL that does not change

ngsrv http 8000 --subdomain laravel-preview

Hand that link to QA or a client. Same URL after you restart the tunnel.

Declarative config for teams

Check a ngsrv.yml into the repo so everyone runs the same tunnel names:

tunnels:
  - name: laravel
    port: 8000
    subdomain: laravel-preview

Then ngsrv run.