Refactor chat configuration: update .env.example for Reverb settings, streamline Pusher configuration in SupportChatController, and enhance chat.js to dynamically determine websocket endpoint based on host. This improves flexibility for local and production environments.

This commit is contained in:
Mekan1206
2026-08-15 20:50:09 +05:00
parent 3a415edb6e
commit f68db67465
4 changed files with 92 additions and 13 deletions

View File

@@ -50,7 +50,9 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
# Storefront widget + Nova inbox 1:1 target (users.id)
CHAT_SUPPORT_USER_ID=
# Laravel Reverb (`php artisan reverb:start`)
# Laravel Reverb (`php artisan reverb:start` / supervisor).
# PHP broadcasts to this host. Browsers use nginx at wss://mm.com.tm/app.
# Local:
REVERB_APP_ID=
REVERB_APP_KEY=
REVERB_APP_SECRET=
@@ -59,6 +61,10 @@ REVERB_PORT=8080
REVERB_SCHEME=http
REVERB_SERVER_HOST=0.0.0.0
REVERB_SERVER_PORT=8080
# Production (keep SERVER_* on 8080; PHP can still use 127.0.0.1:8080):
# REVERB_HOST=127.0.0.1
# REVERB_PORT=8080
# REVERB_SCHEME=http
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"