Laravel native broadcaster
Use Laravel broadcasting with Conveyor’s native HTTP endpoints and native clients, separately from the Echo/Reverb setup.
Release requirements
Broadcaster 0.3.0 is published on Packagist. This guide documents that Composer release. Repository: firebrikdotcom/conveyor-laravel-broadcaster.
Composer package: firebrikdotcom/conveyor-laravel-broadcaster. Version 0.3.0 is registered, indexed and published. See namespace migration. The release requires PHP ^8.3 and Laravel 13.x (Composer ^13.0). The verified release lockfile uses Laravel components 13.40.0; that measured combination does not establish testing of every 13.x version. Run a separate native Conveyor server exposing /conveyor/message and /conveyor/auth. The Laravel application uses HTTP(S) and needs neither OpenSwoole nor conveyor-server-client. Keep separate Composer installations for the server and Laravel application: server 2.6.1 requires guzzlehttp/guzzle ^7.8, while broadcaster 0.3.0 requires ^8.0.
For stock Laravel Echo with pusher-js, follow Laravel Echo / Reverb instead. This native driver sends the JSON event payload to each channel; it does not transmit the Laravel event name as a separate field.
Install and configure
Install the published 0.3.0 package with Composer. Laravel discovers the service provider automatically. Publish its configuration and enable broadcasting:
composer require firebrikdotcom/conveyor-laravel-broadcaster:0.3.0
php artisan vendor:publish --provider='Kanata\LaravelBroadcaster\ConveyorServiceProvider'
php artisan install:broadcasting --without-reverb --without-nodeAdd the connection inside connections in config/broadcasting.php:
'conveyor' => ['driver' => 'conveyor'],Point the published config/conveyor.php at your native server. This example uses the Quick Start port; enable the native HTTP endpoints and configure a matching server secret before using them.
BROADCAST_CONNECTION=conveyor
CONVEYOR_PROTOCOL=ws
CONVEYOR_URI=127.0.0.1
CONVEYOR_PORT=8989
CONVEYOR_QUERY="token=your-server-secret"ws selects HTTP for the server API; wss selects HTTPS. Use HTTPS outside trusted local networks. Keep the query secret on the backend. See native HTTP configuration.
Broadcast and receive
Use Laravel’s broadcasting events with channels such as new Channel('room'). ShouldBroadcast needs a running queue worker; ShouldBroadcastNow sends immediately. Receive messages using a native Conveyor client subscribed to the same channel. HTTP failures and invalid JSON encoding throw, so queued jobs can fail or retry.
For private channels, authenticate the user and authorize the requested channel in an application endpoint before obtaining a token:
use Kanata\LaravelBroadcaster\Conveyor;
// Only after your application has authorized this channel:
$token = Conveyor::getToken('private-room');getToken() asks the server for a channel token; it does not authorize an application user. An empty query disables token retrieval and returns an empty string. Never send the server query secret to a browser. Native token handling and Pusher signed authorization responses are different; see authorization.
Upgrade from 0.2
- Upgrade to PHP 8.3+ and Laravel 13.x, and resolve the release’s JWT 7 and Guzzle 8 dependencies.
- JWT signing names must contain at least 32 bytes. Handle HTTP/JSON exceptions, expired-token rejection and enforced token use limits.
- Before upgrading, revoke or backfill old token records intended to be limited whose
usesvalue is null. - Remove copied
config.platform.ext-openswooleoverrides. The Laravel HTTP integration does not require a fake extension or a local server dependency.
The optional local token command and authentication helpers need a conveyor_tokens table. Follow the repository’s migration/schema documentation before enabling them. Server-side association helpers additionally need compatible Conveyor persistence interfaces in a separately provisioned server process.
Test broadcast delivery, application authorization, token expiry/use limits and HTTP failure behavior in your own integration. See the ecosystem overview for release status and component roles.