userId = data_get($data, 'userId'); $this->downloadPath = data_get($data, 'downloadPath'); $containerName = data_get($data, 'containerName'); $serverId = data_get($data, 'serverId'); if (filled($containerName) && filled($serverId)) { // Clean up the MinIO client container $commands = []; $commands[] = "docker stop {$containerName} 2>/dev/null || true"; $commands[] = "docker rm {$containerName} 2>/dev/null || true"; instant_remote_process($commands, Server::find($serverId), throwError: false); } } public function broadcastOn(): ?array { if (is_null($this->userId)) { return []; } return [ new PrivateChannel("user.{$this->userId}"), ]; } public function broadcastWith(): array { return [ 'downloadPath' => $this->downloadPath, ]; } }