user()->currentTeam()->id ?? null; } if (is_null($teamId)) { throw new \Exception('Team id is null'); } $this->teamId = $teamId; } public function broadcastOn(): array { return [ new PrivateChannel("team.{$this->teamId}"), ]; } }