getBuilder()->withCount('databases')->with('node')->get(); } /** * Return a database host with the databases and associated servers * that are attached to said databases. * * @param int $id * @return \Pterodactyl\Models\DatabaseHost * * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function getWithServers(int $id): DatabaseHost { try { return $this->getBuilder()->with('databases.server')->findOrFail($id, $this->getColumns()); } catch (ModelNotFoundException $exception) { throw new RecordNotFoundException; } } }