PHPackages                             kcesys/php-genealogy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kcesys/php-genealogy

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kcesys/php-genealogy
====================

Framework-agnostic PHP library for genealogy graph structures

1568PHP

Since Dec 15Pushed 6mo agoCompare

[ Source](https://github.com/KCESYS/php-genealogy)[ Packagist](https://packagist.org/packages/kcesys/php-genealogy)[ RSS](/packages/kcesys-php-genealogy/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Genealogy
=============

[](#php-genealogy)

A framework-agnostic PHP SDK for managing genealogy data structures compatible with [@kcesys/react-genealogy](https://github.com/KCESYS/react-genealogy).

Installation
------------

[](#installation)

```
composer require kcesys/php-genealogy
```

Usage
-----

[](#usage)

Use the `Builder` to transform your raw data (Arrays, Objects, Database Models) into a valid Graph structure.

```
use KCESYS\Genealogy\Builder;

$users = [
    (object)['id' => 1, 'name' => 'Grandpa', 'father_id' => null],
    (object)['id' => 2, 'name' => 'Father', 'father_id' => 1],
];

$graph = Builder::from($users)
    ->mapId(fn($u) => $u->id)
    ->mapLabel(fn($u) => $u->name)
    ->mapParents(fn($u) => $u->father_id ? [$u->father_id] : [])
    ->build();

// Output JSON for React
echo json_encode($graph);
```

Manual Construction
-------------------

[](#manual-construction)

You can also build the graph manually using `FamilyNode`.

```
use KCESYS\Genealogy\GenealogyGraph;
use KCESYS\Genealogy\FamilyNode;

$graph = new GenealogyGraph();
$node = new FamilyNode('1', ['label' => 'Me']);
$graph->addNode($node);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance46

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/181174959?v=4)[KCESYS Ltd](/maintainers/KCESYS)[@KCESYS](https://github.com/KCESYS)

### Embed Badge

![Health badge](/badges/kcesys-php-genealogy/health.svg)

```
[![Health](https://phpackages.com/badges/kcesys-php-genealogy/health.svg)](https://phpackages.com/packages/kcesys-php-genealogy)
```

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4216.5M114](/packages/livewire-volt)[glorand/laravel-model-settings

Model Settings for your Laravel app

9141.2M4](/packages/glorand-laravel-model-settings)[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.5M38](/packages/prologue-alerts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
