PHPackages                             umbrellio/laravel-ltree - 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. [Database &amp; ORM](/categories/database)
4. /
5. umbrellio/laravel-ltree

ActiveLibrary[Database &amp; ORM](/categories/database)

umbrellio/laravel-ltree
=======================

Extension LTree (Postgres) for Laravel

8.1.0(1y ago)34120.1k↓37.4%12[1 issues](https://github.com/umbrellio/laravel-ltree/issues)[3 PRs](https://github.com/umbrellio/laravel-ltree/pulls)MITPHPPHP ^8.3|^8.4CI failing

Since Jul 16Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/umbrellio/laravel-ltree)[ Packagist](https://packagist.org/packages/umbrellio/laravel-ltree)[ RSS](/packages/umbrellio-laravel-ltree/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (8)Versions (75)Used By (0)

laravel-ltree
=============

[](#laravel-ltree)

[![Github Status](https://github.com/umbrellio/laravel-ltree/workflows/CI/badge.svg)](https://github.com/umbrellio/laravel-ltree/actions)[![Coverage Status](https://camo.githubusercontent.com/47cac9f2a09c0b2975ccd45ca083e7d713450d126039c9e4367d77646650ae23/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f756d6272656c6c696f2f6c61726176656c2d6c747265652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/umbrellio/laravel-ltree?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/d57f4d144aebefdda5575e31183a3273b74e71ae85d4673d24cb0fa798adfc02/68747470733a2f2f706f7365722e707567782e6f72672f756d6272656c6c696f2f6c61726176656c2d6c747265652f762f737461626c652e706e67)](https://packagist.org/packages/umbrellio/laravel-ltree)[![Total Downloads](https://camo.githubusercontent.com/94670e77d7beada6bd1153338eacc82bfdffc37e0b6bde11cfc9bbd0cb353be2/68747470733a2f2f706f7365722e707567782e6f72672f756d6272656c6c696f2f6c61726176656c2d6c747265652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/umbrellio/laravel-ltree)[![Code Intelligence Status](https://camo.githubusercontent.com/a8918243578dd227936e6f335587d01a6b25f3c809d1a7935c38a54aad1a206c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756d6272656c6c696f2f6c61726176656c2d6c747265652f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Build Status](https://camo.githubusercontent.com/a96f9381e0b06f4d4f5b79eac77831e9c8947923fd286fc7af407a06537ff7f6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756d6272656c6c696f2f6c61726176656c2d6c747265652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/umbrellio/laravel-ltree/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/e8193c41a86291268a2645c039b2f99f348ef31be1a20d181018ee55305cb70a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756d6272656c6c696f2f6c61726176656c2d6c747265652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/umbrellio/laravel-ltree/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0a9d57d2ac3c91dcd02acbd3ef44b127ea862babdb2261b406b7b2daca941da6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756d6272656c6c696f2f6c61726176656c2d6c747265652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/umbrellio/laravel-ltree/?branch=master)

LTree Extension (PostgreSQL) for Laravel.

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

[](#installation)

Run this command to install:

```
php composer.phar require umbrellio/laravel-ltree
```

How to use
----------

[](#how-to-use)

Implement your `Eloquent\Model` from `LTreeModelInterface` and use `LTreeModelTrait`.

Use LTreeService for build path:

1. when create model: `createPath(LTreeModelInterface $model)`
2. when update model: `updatePath(LTreeModelInterface $model)` for update path for model and children
3. when delete model: `dropDescendants(LTreeModelInterface $model)` for delete children models

The `get()` method returns `LTreeCollection`, instead of the usual `Eloquent\Collection`.

`LTreeCollection` has a `toTree()` method that converts a flat collection to a tree.

`LTreeResourceCollection` &amp; `LTreeResource`, which take `LTreeCollection` as an argument, will also be useful.

Authors
-------

[](#authors)

Created by Korben Dallas.

[![Supported by Umbrellio](https://camo.githubusercontent.com/cfae343fcdcb3e8680353f5f058271ed6a749151ae073ae4d9e083e5e1aeb045/68747470733a2f2f756d6272656c6c696f2e6769746875622e696f2f556d6272656c6c696f2f737570706f727465645f62795f756d6272656c6c696f2e737667)](https://github.com/umbrellio/)

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance68

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity92

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 86.9% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~96 days

Total

68

Last Release

396d ago

Major Versions

5.3.1 → 6.0.02020-12-19

6.8.4 → 7.0.02021-02-24

7.5.0 → 8.0.02024-05-02

7.5.1 → 8.0.12024-05-16

7.5.2 → 8.1.02025-06-03

PHP version history (7 changes)1.0.0PHP ^7.2

3.9.0PHP ^7.2|^7.3

5.1.0PHP 7.\*

6.0.0PHP ^7.3|^7.4|^8.0

7.4.2PHP ^7.3|^7.4|^8.0|^8.1

7.5.0PHP ^7.3|^7.4|^8.0|^8.1|^8.2

8.0.0PHP ^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc9857312ea8b712392a916097419ba7eff3c0588efb3115ff1ddfd468e57ac5?d=identicon)[lazeevv\_](/maintainers/lazeevv_)

![](https://www.gravatar.com/avatar/023972c6d4f6faeb92150036503d5cbcf7b01217869ad8ea29a07b677c075807?d=identicon)[umbrellio](/maintainers/umbrellio)

![](https://avatars.githubusercontent.com/u/16900171?v=4)[Corben Dallas](/maintainers/pvsaintpe)[@pvsaintpe](https://github.com/pvsaintpe)

---

Top Contributors

[![pvsaintpe](https://avatars.githubusercontent.com/u/16900171?v=4)](https://github.com/pvsaintpe "pvsaintpe (73 commits)")[![Zlob](https://avatars.githubusercontent.com/u/3818931?v=4)](https://github.com/Zlob "Zlob (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![jamesrusso](https://avatars.githubusercontent.com/u/682807?v=4)](https://github.com/jamesrusso "jamesrusso (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![cugrif](https://avatars.githubusercontent.com/u/52412060?v=4)](https://github.com/cugrif "cugrif (1 commits)")[![Art4es](https://avatars.githubusercontent.com/u/22673518?v=4)](https://github.com/Art4es "Art4es (1 commits)")

---

Tags

extensionlaravellaravel-ltreeltreeltree-extensionpgsqlphppostgrespostgresqltreephplaravelpostgresqlpostgrestreeltreepgltree-extension

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/umbrellio-laravel-ltree/health.svg)

```
[![Health](https://phpackages.com/badges/umbrellio-laravel-ltree/health.svg)](https://phpackages.com/packages/umbrellio-laravel-ltree)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[tpetry/laravel-postgresql-enhanced

Support for many missing PostgreSQL specific features

1.0k2.4M29](/packages/tpetry-laravel-postgresql-enhanced)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4585.8M4](/packages/martin-georgiev-postgresql-for-doctrine)[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

103451.2k1](/packages/umbrellio-laravel-pg-extensions)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k3.5k](/packages/leantime-leantime)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)

PHPackages © 2026

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