localhoist/laravel

php artisan share — put your local Laravel dev environment online with Vite HMR, Reverb websockets, and signed URLs all working through one tunnel.

Maintainers

Package info

github.com/xPapay/localhoist-laravel

Homepage

Issues

pkg:composer/localhoist/laravel

Transparency log

Statistics

Installs: 18

Dependents: 0

Suggesters: 0

Stars: 0

v0.2.3 2026-07-11 05:17 UTC

This package is auto-updated.

Last update: 2026-07-11 05:27:38 UTC


README

php artisan share — the Laravel-native entry point for localhoist. Puts your local dev environment online with Vite HMR, Reverb websockets, and signed URLs all working through one tunnel, zero config. With this package installed, localhoist also stops touching your .env entirely.

Development happens in the localhoist monorepo (packages/laravel); this repository is a read-only split for Composer. Report issues there.

Install

composer require --dev localhoist/laravel

If the package isn't on Packagist yet, install straight from the split repository:

composer config repositories.localhoist vcs https://github.com/xPapay/localhoist-laravel
composer require --dev "localhoist/laravel:^0.1"

Hacking on the monorepo? Use a path repository instead:

composer config repositories.localhoist path /path/to/localhoist/packages/laravel
composer require --dev "localhoist/laravel:*@dev"

Usage

php artisan share
php artisan share --domain=my-app.ngrok-free.dev
php artisan share --no-qr

Zero .env mutation

The package ships a TrustLocalhoistProxy middleware, auto-registered in the local environment. The localhoist mux stamps every proxied request with an X-Localhoist marker; the middleware trusts the proxy only when the request comes from loopback and carries that marker. Laravel then derives scheme and host from the tunnel's X-Forwarded-* headers, so url(), asset(), redirects, and signed URLs are generated against the public https origin — with .env untouched.

The binary detects this package in composer.lock (>= 0.2) and skips its .env patching automatically. Forwarded headers on requests without the marker are ignored, and nothing is trusted outside the local environment.

Edge case: URLs generated outside a request (e.g. links in queued emails) still come from APP_URL. Run php artisan share --env-patch when you need those pointing at the tunnel.

How it finds the binary

The command is a thin wrapper around the localhoist Go binary (tailwindcss-standalone pattern). Resolution order:

  1. LOCALHOIST_BINARY environment variable
  2. localhoist on your PATH
  3. ~/.localhoist/bin/ cache
  4. Downloaded from the matching GitHub release (first run only)

Until binaries are published, build from source and use option 1 or 2: go build ./cmd/localhoist.

Note for Sail users: run this on your host, not inside the container — the tunnel needs the host's published ports and your host ngrok install. The command warns when it detects a container.