$list_families = $list_families
            ->filter(function (stdClass $value) use ($tree): bool {
                $fam = Registry::familyFactory()->make($value->f_id, $tree);
                return $fam !== null && $fam->canShow();
            })