jengo / broadcasting
Enterprise-grade real-time event broadcasting subsystem for CodeIgniter 4 and the Jengo Framework with Pusher, Soketi, Server-Sent Events (SSE), and Redis support.
Requires
- php: ^8.2
- codeigniter4/framework: ^4.6|^4.7
- jengo/base: ^1.1
Requires (Dev)
- phpunit/phpunit: ^11.5
Suggests
- predis/predis: Required when utilizing the Redis broadcasting driver
- pusher/pusher-php-server: Alternative vendor client for legacy Pusher setups (native CI4 cURL driver is used by default)
Provides
None
Conflicts
None
Replaces
None
README
Real-time event broadcasting subsystem for CodeIgniter 4 and the Jengo Framework.
Documentation: https://lipex-org.github.io/jengophp.com/packages/broadcasting
Warning
Active Development / Experimental: This package and its built-in development WebSocket daemon (php spark broadcast:serve) are in active development and are not production-ready.
Installation
composer require jengo/broadcasting php spark jengo:install broadcasting
Quick Start
use Jengo\Broadcasting\Broadcast; use App\Events\OrderPlaced; // 1. Dispatch an event implementing ShouldBroadcast broadcast(new OrderPlaced($order->id, $order->total)); // 2. Direct ad-hoc fluent broadcast Broadcast::on('orders') ->as('OrderPlaced') ->with(['id' => 101, 'total' => 450.00]) ->toOthers() ->send(); // 3. Testing double Broadcast::fake(); // ... run application code ... Broadcast::assertBroadcasted(OrderPlaced::class);
Local Development Server
Run the built-in WebSocket daemon for local testing:
php spark broadcast:serve
Documentation
For full documentation on multi-driver setup (SSE, Soketi, Pusher, Redis, Ably), channel authorization, practical application patterns, and testing fakes, visit https://lipex-org.github.io/jengophp.com/packages/broadcasting.
License
Released under the MIT License.