connectionManager = $connectionManager; } public function handle(Request $request, ConnectionInterface $httpConnection) { if ($request->has('server_host')) { $connection = $this->connectionManager->findControlConnectionForSubdomainAndServerHost($request->get('id'), $request->get('server_host')); } else { $connection = $this->connectionManager->findControlConnectionForClientId($request->get('id')); } if (! is_null($connection)) { $connection->close(); $this->connectionManager->removeControlConnection($connection); } $httpConnection->send(respond_json([ 'sites' => $this->connectionManager->getConnections(), ])); } }