Skip to content
Discussion options

You must be logged in to vote

This is already supported, and you have a few options available.

At dispatch time:

broadcast(new CorpReportCentEvent($message))->via(CentConnectionEnum::CENT_CORP->value);

In the constructor (requires trait):

class CorpReportCentEvent implements ShouldBroadcastNow
{
    use Dispatchable, SerializesModels, InteractsWithBroadcasting;

    public function __construct(public array $message)                        
    {                                                                         
        $this->broadcastVia(CentConnectionEnum::CENT_CORP->value);            
    } 
}

Define a method (no trait needed):

class CorpReportCentEvent implements ShouldBroadcastNow                       
{ …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Mishanki
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants