localhoist/laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  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.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固