payload = $payload; $this->connection = $connection; $this->channelManager = $channelManager; } /** * Respond to the message construction. * * @return void */ public function respond() { if (! Str::startsWith($this->payload->event, 'client-')) { return; } if (! $this->connection->app->clientMessagesEnabled) { return; } $channel = $this->channelManager->find( $this->connection->app->id, $this->payload->channel ); optional($channel)->broadcastToEveryoneExcept( $this->payload, $this->connection->socketId, $this->connection->app->id ); DashboardLogger::log($this->connection->app->id, DashboardLogger::TYPE_WS_MESSAGE, [ 'socketId' => $this->connection->socketId, 'channel' => $this->payload->channel, 'event' => $this->payload->event, 'data' => $this->payload, ]); } }