localhoist/laravel
Composer 安装命令:
composer require 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.
README 文档
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:
LOCALHOIST_BINARYenvironment variablelocalhoiston yourPATH~/.localhoist/bin/cache- 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.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-10