From 6d4baf921482d09f9badba5343d2cbd0919d596d Mon Sep 17 00:00:00 2001 From: Victor Kislichenko Date: Thu, 25 Feb 2021 18:19:49 +0200 Subject: [PATCH] Configurable broadcast queue --- published/config.stub | 7 +++++++ src/LockEvent.php | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/published/config.stub b/published/config.stub index 082e8cc..0599722 100644 --- a/published/config.stub +++ b/published/config.stub @@ -66,4 +66,11 @@ return [ Sofa\ModelLocking\ModelLocked::class => null, Sofa\ModelLocking\ModelUnlocked::class => null, ], + + /* + |-------------------------------------------------------------------------- + | Queue where broadcasts are dispatched to. + |-------------------------------------------------------------------------- + */ + 'broadcast_queue' => null, ]; diff --git a/src/LockEvent.php b/src/LockEvent.php index 06a3722..bc2fb0b 100644 --- a/src/LockEvent.php +++ b/src/LockEvent.php @@ -21,6 +21,16 @@ public function __construct($model) $this->model = $model; } + /** + * Get the queue where broadcasts are dispatched to. + * + * @return string|null + */ + public function broadcastQueue() + { + return config('model_locking.broadcast_queue'); + } + /** * Get the channels the event should broadcast on. *