File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 228228 'whitelist ' => true ,
229229 ],
230230 'database_connection ' => env ('TOTEM_DATABASE_CONNECTION ' ),
231+
232+ 'broadcasting ' => [
233+ 'enabled ' => env ('TOTEM_BROADCASTING_ENABLED ' , true ),
234+ 'channel ' => env ('TOTEM_BROADCASTING_CHANNEL ' , 'task.events ' ),
235+ ],
231236];
Original file line number Diff line number Diff line change 22
33namespace Studio \Totem \Events ;
44
5- use Studio \Totem \Task ;
65use Illuminate \Broadcasting \PrivateChannel ;
76use Illuminate \Broadcasting \InteractsWithSockets ;
87use Illuminate \Contracts \Broadcasting \ShouldBroadcast ;
@@ -12,27 +11,22 @@ class BroadcastingEvent extends TaskEvent implements ShouldBroadcast
1211 use InteractsWithSockets;
1312
1413 /**
15- * @var Task
16- */
17- public $ task ;
18-
19- /**
20- * constructor.
14+ * Get the channels the event should broadcast on.
2115 *
22- * @param Task $task
16+ * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|PrivateChannel
2317 */
24- public function __construct ( Task $ task )
18+ public function broadcastOn ( )
2519 {
26- parent :: __construct ( $ task );
20+ return new PrivateChannel ( config ( ' totem.broadcasting.channel ' ) );
2721 }
2822
2923 /**
30- * Get the channels the event should broadcast on .
24+ * Toggles event broadcasting on/off based on config value .
3125 *
32- * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|PrivateChannel
26+ * @return bool
3327 */
34- public function broadcastOn ()
28+ public function broadcastWhen ()
3529 {
36- return new PrivateChannel ( ' task.events ' );
30+ return config ( ' totem.broadcasting.enabled ' );
3731 }
3832}
You can’t perform that action at this time.
0 commit comments