Package Data | |
---|---|
Maintainer Username: | cxbyte |
Maintainer Contact: | cxbyte@mail.ru (Andrey Petrov) |
Package Create Date: | 2016-11-14 |
Package Last Update: | 2016-11-22 |
Language: | PHP |
License: | GPL |
Last Refreshed: | 2024-11-19 03:02:00 |
Package Statistics | |
---|---|
Total Downloads: | 46 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 1 |
Total Forks: | 1 |
Total Open Issues: | 0 |
#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'))