cxbyte / laravel-zmq-driver
Zmq broadcasting driver for Laravel
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=5.4
- illuminate/support: ~5.1
This package is not auto-updated.
Last update: 2024-11-24 02:53:56 UTC
README
#Zmq broadcasting driver for Laravel
#Installation
composer require cxbyte/laravel-zmq-driver
#Configure
-
add to your config/app.php in providers section
Cxbyte\ZmqDriver\ZmqDriverServiceProvider::class
-
add to your .env file
BROADCAST_DRIVER=zmq
BROADCAST_ZMQ_PORT=5555
#Using
You have to create your own event class extends from Cxbyte\ZmqDriver\Events\AbstractEvent
and define broadcastOn
method with channels for broadcasting.
Sample event class SampleEvent.php you can see in Events folder.
public function broadcastOn() { return new Channel('items'); define your channels here }
The channels should be instances of Channel, PrivateChannel, or PresenceChannel.
More info Laravel broadcast events
And then you can fire event like
event(new Cxbyte\ZmqDriver\Events\SampleEvent('hello'))