5 use App\Models\Protocol;
6 use Illuminate\Broadcasting\Channel;
7 use Illuminate\Broadcasting\InteractsWithSockets;
8 use Illuminate\Broadcasting\PresenceChannel;
9 use Illuminate\Broadcasting\PrivateChannel;
10 use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
11 use Illuminate\Foundation\Events\Dispatchable;
12 use Illuminate\Queue\SerializesModels;
14 class ProtocolAdded implements ShouldBroadcast
16 use Dispatchable, InteractsWithSockets, SerializesModels;
19 * Create a new event instance.
23 public function __construct(Protocol $protocol)
25 $protocol->load('user');
26 $this->protocol = $protocol;
30 * Get the channels the event should broadcast on.
32 * @return \Illuminate\Broadcasting\Channel|array
34 public function broadcastOn()
36 return new PrivateChannel('Protocol.'.$this->protocol->tournament_id);