public function linkedRepositories(string $link): array
    {
        $rows = DB::table('other')
            ->join('link', static function (JoinClause $join): void {
                $join->on('l_file', '=', 'o_file')->on('l_from', '=', 'o_id');
            })
            ->where('o_file', '=', $this->tree->id())
            ->where('o_type', '=', 'REPO')
            ->where('l_type', '=', $link)
            ->where('l_to', '=', $this->xref)
            ->select(['o_id AS xref', 'o_gedcom AS gedcom'])
            ->get();

        $list = [];
        foreach ($rows as $row) {
            $record = Repository::getInstance($row->xref, $this->tree, $row->gedcom);
            if ($record->canShowName()) {
                $list[] = $record;
            }
        }

        return $list;
    }