logger = $logger; } public function handle(Request $request, ConnectionInterface $httpConnection) { $subdomain = $request->get('subdomain'); $this->logger->getLogsBySubdomain($subdomain) ->then(function ($logs) use ($httpConnection) { $httpConnection->send( respond_json(['logs' => $logs]) ); $httpConnection->close(); }); } }