Download the PHP package relaystacks/laravel-conduit without Composer
On this page you can find all versions of the php package relaystacks/laravel-conduit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download relaystacks/laravel-conduit
More information about relaystacks/laravel-conduit
Files in relaystacks/laravel-conduit
Package laravel-conduit
Short Description Laravel broadcast driver for the Conduit ecosystem. Writes events to a Unix socket via relaystacks/conduit-php.
License MIT
Informations about the package laravel-conduit
relaystacks/laravel-conduit
Laravel broadcast driver for the RelayStacks Conduit ecosystem — real-time events on shared hosting without Redis, Pusher, or long-running PHP.
Why Conduit
Most real-time broadcasting solutions require Redis, a paid service like Pusher, or the ability to run long-lived PHP processes. On shared cPanel hosting, none of these are available.
Conduit solves this by using a Unix domain socket to send events from PHP to a lightweight Node.js relay server that runs under Passenger. The Node server is a "dumb middleman" — Laravel owns all business logic, channel authorization, and presence tracking. No infrastructure beyond what cPanel already provides.
How It Works
Installation
The service provider is auto-discovered — no manual registration needed.
Publish the config file:
Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
CONDUIT_SOCKET_PATH |
— | Absolute path to the Unix socket file |
CONDUIT_SECRET |
null |
Shared HMAC-SHA256 secret (must match conduit-echo) |
CONDUIT_TIMEOUT |
2 |
Socket timeout in seconds |
Broadcasting Config
Add the conduit connection to config/broadcasting.php:
Set the default driver in .env:
Usage
Broadcast Events
Create events the standard Laravel way:
Channel Types
Public channels — no authorization:
Private channels — require an authenticated user:
Presence channels — track who is online:
Guest Presence
Presence channels can accept unauthenticated users by using a nullable type hint:
Channels with a non-nullable User type hint will reject unauthenticated users automatically.
Channel Authorization
The conduit-echo Node server authorizes private and presence channels by POSTing to Laravel's /broadcasting/auth endpoint, forwarding the browser's session cookies.
Define channel callbacks in routes/channels.php:
API Reference
ConduitServiceProvider
Registered automatically via package auto-discovery. Merges the default config and registers the conduit broadcast driver with Laravel's BroadcastManager.
Published config tag: conduit-config
ConduitBroadcaster
Extends Illuminate\Broadcasting\Broadcasters\Broadcaster.
| Method | Description |
|---|---|
auth($request) |
Authorize a channel subscription. Private channels require authentication; presence channels defer to the channel callback's type hint. |
validAuthenticationResponse($request, $result) |
Build the JSON auth response. For presence channels, includes channel_data with user_id and user_info. |
broadcast(array $channels, $event, array $payload) |
Send an event to channels via the transport. Failures are logged, not thrown. |
Troubleshooting
Events not reaching the browser:
- Verify
CONDUIT_SOCKET_PATHmatches between PHP and Node configs - Check that conduit-echo is running:
GET /healthshould return{"status":"ok"} - Check file permissions on the socket file (should be readable/writable by both PHP and Node processes)
Channel auth failing:
- Ensure
/broadcasting/authis accessible fromlocalhost(the Node server POSTs to it) - Verify cookies/session are being forwarded (check
CONDUIT_AUTH_ENDPOINTin Node config) - For presence channels, ensure the channel callback returns an array (not
true)
Requirements
- PHP >= 8.1
- Laravel 10, 11, 12, or 13
relaystacks/conduit-php(auto-required as a dependency)
License
MIT
All versions of laravel-conduit with dependencies
relaystacks/conduit-php Version ^1.0
illuminate/broadcasting Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0