Real-Time Updates with Laravel Reverb Broadcasting

PagibleAI CMS supports real-time broadcasting of content changes across admin sessions using Laravel Reverb, a first-party WebSocket server built specifically for Laravel applications. When broadcasting is enabled, changes made by one editor — such as saving pages, uploading files, or updating shared elements — are instantly reflected in other editors' admin panels without requiring a page refresh.

This guide walks you through configuring both the CMS application and the Reverb WebSocket server to enable real-time collaboration in your PagibleAI installation.

PagibleAI CMS Configuration

Broadcasting is disabled by default in PagibleAI CMS. To enable real-time updates, add the following environment variables to the .env file of your Laravel application running PagibleAI. These settings tell the CMS admin panel where to connect to the Reverb WebSocket server and how to authenticate with it.

CMS_BROADCAST=true
REVERB_HOST=127.0.0.1
REVERB_PORT=8800
REVERB_SCHEME=http
REVERB_APP_ID=pagible
REVERB_APP_KEY=pagible-key
REVERB_APP_SECRET=pagible-pass

CMS_BROADCAST — Master switch that enables real-time event broadcasting in the PagibleAI admin panel. Set to true to activate WebSocket connections for all admin users.

REVERB_HOST — The hostname or IP address where the Reverb WebSocket server is reachable from the client browser. Use 127.0.0.1 for local development or your public domain name for production deployments.

REVERB_PORT — The port the WebSocket server listens on. The default 8800 avoids conflicts with common web server ports (80, 443, 8080).

REVERB_SCHEME — The protocol used for the WebSocket connection: http for local development, https for production environments with TLS termination.

REVERB_APP_ID, REVERB_APP_KEY, REVERB_APP_SECRET — Authentication credentials that must match exactly between the CMS application and the Reverb server. Replace the example values with your own secure secrets in production environments.

Laravel Reverb Server Setup

Laravel Reverb must be installed and configured on the server that will handle WebSocket connections. This can be the same server running your Laravel application or a separate dedicated WebSocket server. Start by installing the Laravel broadcasting infrastructure with Reverb as the driver.

Run the following Artisan command to install Laravel's broadcasting system with Reverb:

php artisan install:broadcasting --reverb

This command publishes the Reverb configuration file, installs the required Composer and NPM dependencies, and registers the broadcasting service provider. Next, configure the Reverb server by adding these environment variables to your server's .env file:

REVERB_APP_ID=pagible
REVERB_APP_KEY=pagible-key
REVERB_APP_SECRET=pagible-pass

REVERB_SERVER_HOST=127.0.0.1
REVERB_SERVER_PORT=8800
REVERB_MAX_REQUEST_SIZE=100_000
REVERB_APP_MAX_MESSAGE_SIZE=100_000

REVERB_APP_ID, REVERB_APP_KEY, REVERB_APP_SECRET — Must match the values configured in the CMS application exactly. These credentials authenticate the connection between your Laravel app and the Reverb WebSocket server.

REVERB_SERVER_HOST — The network interface the Reverb server binds to. Use 127.0.0.1 to only accept local connections (recommended when running behind a reverse proxy like Nginx), or 0.0.0.0 to listen on all network interfaces.

REVERB_SERVER_PORT — The port Reverb listens on. This must match the REVERB_PORT value in the CMS configuration above.

REVERB_MAX_REQUEST_SIZE — Maximum allowed HTTP request payload size in bytes (default 100,000). Increase this value if you need to broadcast large content updates.

REVERB_APP_MAX_MESSAGE_SIZE — Maximum WebSocket message size in bytes (default 100,000). Should match or exceed REVERB_MAX_REQUEST_SIZE to prevent message truncation.

Once configured, start the Reverb WebSocket server:

php artisan reverb:start

In production, you should run the Reverb server as a daemon process using a process manager like Supervisor to ensure it restarts automatically on failure. You will also typically place it behind a reverse proxy such as Nginx to handle TLS termination and WebSocket upgrade requests. For detailed production deployment instructions — including Supervisor configuration, Nginx reverse proxy setup, and performance tuning — refer to the Laravel Reverb production documentation.