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

1571PHP

Since Dec 15Pushed 8mo 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 2w 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

20

—

LowBetter than 12% of packages

Maintenance43

Moderate activity, may be stable

Popularity16

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

[asantibanez/livewire-charts

Livewire Charts

8971.0M5](/packages/asantibanez-livewire-charts)[rawilk/filament-password-input

Enhanced password input component for filament.

52274.9k18](/packages/rawilk-filament-password-input)[barcode-bakery/barcode-1d

Generates 1D barcodes from a PHP server to a file or HTML document.

10157.1k1](/packages/barcode-bakery-barcode-1d)[jarednova/mesh

package to programitcaily create content for WordPress

186.6k5](/packages/jarednova-mesh)[zackkitzmiller/nil

201.5k](/packages/zackkitzmiller-nil)

PHPackages © 2026

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