File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,7 +244,19 @@ protected function shouldBroadcast(array $payload)
244244 {
245245 return isset ($ payload [0 ]) &&
246246 $ payload [0 ] instanceof ShouldBroadcast &&
247- $ this ->checkBroadcastCondition ($ payload [0 ]);
247+ $ this ->broadcastWhen ($ payload [0 ]);
248+ }
249+
250+ /**
251+ * Check if event should be broadcasted by condition.
252+ *
253+ * @param mixed $event
254+ * @return bool
255+ */
256+ protected function broadcastWhen ($ event )
257+ {
258+ return method_exists ($ event , 'broadcastWhen ' )
259+ ? $ event ->broadcastWhen () : true ;
248260 }
249261
250262 /**
@@ -548,20 +560,4 @@ public function setQueueResolver(callable $resolver)
548560
549561 return $ this ;
550562 }
551-
552- /**
553- * Check if event should be broadcasted by condition.
554- *
555- * @param $event
556- *
557- * @return bool
558- */
559- protected function checkBroadcastCondition ($ event )
560- {
561- if (method_exists ($ event , 'broadcastWhen ' )) {
562- return $ event ->broadcastWhen ();
563- }
564-
565- return true ;
566- }
567563}
You can’t perform that action at this time.
0 commit comments