jn-jairo/laravel-ngrok

使用 ngrok 分享 Laravel 应用。

v3.0.2 2024-03-14 23:34 UTC

This package is auto-updated.

Last update: 2024-09-15 01:02:15 UTC


README

Total Downloads Latest Stable Version License

使用 ngrok 分享 Laravel 应用

本扩展包允许您通过 ngrok 分享您的 Laravel 应用。

要求

  • Ngrok >= 2.2.8 (如果您使用 Laravel Homestead,则此软件可能已安装)

版本兼容性

安装

您可以通过 composer 安装此包。

composer require --dev jn-jairo/laravel-ngrok

NgrokServiceProvider 将自动为您注册。

使用方法

只需调用 artisan 命令以启动 ngrok。

php artisan ngrok

ngrok 的参数将从您的应用程序中提取。

高级使用

php artisan ngrok [options] [--] [<host-header>]

示例

# If you have multiples apps (myapp.test, my-other-app.test, ...)
# set it in the app.url configuration
# or pass it in the host-header argument

php artisan ngrok myapp.test

# If you use a different port, set it in the app.url configuration
# or pass it in the --port option

php artisan ngrok --port=8000 myapp.test

# If you use docker and have containers like (nginx, php, workspace)
# and wanna run the command inside the workspace container
# pass the name of the container the requests will tunnel through

php artisan ngrok --host=nginx example.com

# If you wanna pass other arguments directly to ngrok
# use the --extra or -E option

php artisan ngrok --extra='--region=eu' -E'--config=ngrok.yml'

许可证

MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件