From e42fca3c5b79c6ead74f14c005837de47881354f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez?= Date: Sun, 26 Apr 2026 13:45:21 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20inyectar=20config=20de=20Reverb=20desde?= =?UTF-8?q?=20PHP=20en=20runtime=20para=20producci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- resources/js/echo.js | 14 ++++++++------ resources/views/layouts/landing.blade.php | 11 +++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/resources/js/echo.js b/resources/js/echo.js index 789682e5..404b5a58 100644 --- a/resources/js/echo.js +++ b/resources/js/echo.js @@ -3,12 +3,14 @@ import Pusher from 'pusher-js'; window.Pusher = Pusher; +const cfg = window.reverbConfig ?? {}; + window.Echo = new Echo({ - broadcaster: 'reverb', - key: import.meta.env.VITE_REVERB_APP_KEY, - wsHost: import.meta.env.VITE_REVERB_HOST, - wsPort: import.meta.env.VITE_REVERB_PORT ?? 80, - wssPort: import.meta.env.VITE_REVERB_PORT ?? 443, - forceTLS: false, + broadcaster: 'reverb', + key: cfg.key ?? import.meta.env.VITE_REVERB_APP_KEY, + wsHost: cfg.host ?? import.meta.env.VITE_REVERB_HOST, + wsPort: cfg.port ?? import.meta.env.VITE_REVERB_PORT ?? 80, + wssPort: cfg.port ?? import.meta.env.VITE_REVERB_PORT ?? 443, + forceTLS: cfg.forceTLS ?? false, enabledTransports: ['ws', 'wss'], }); diff --git a/resources/views/layouts/landing.blade.php b/resources/views/layouts/landing.blade.php index 2d581d36..64210786 100644 --- a/resources/views/layouts/landing.blade.php +++ b/resources/views/layouts/landing.blade.php @@ -28,6 +28,17 @@ {{-- Livewire --}} @livewireScripts +{{-- Config de Reverb inyectada en runtime para que funcione en producción --}} + + {{-- Vite (Echo/Reverb) --}} @vite(['resources/js/app.js'])