umbrellio/laravel-ltree is a Laravel package for extension ltree (postgres) for laravel.
It currently has 34 GitHub stars and 119.419 downloads on Packagist (latest version 8.1.0).
Install it with composer require umbrellio/laravel-ltree.
Discover more Laravel packages by umbrellio
or browse all Laravel packages to compare alternatives.
Last updated
LTree Extension (PostgreSQL) for Laravel.
Run this command to install:
php composer.phar require umbrellio/laravel-ltree
Implement your Eloquent\Model from LTreeModelInterface and use LTreeModelTrait.
Use LTreeService for build path:
createPath(LTreeModelInterface $model)updatePath(LTreeModelInterface $model) for update path for model and childrendropDescendants(LTreeModelInterface $model) for delete children modelsThe get() method returns LTreeCollection, instead of the usual Eloquent\Collection.
LTreeCollection has a toTree() method that converts a flat collection to a tree.
LTreeResourceCollection & LTreeResource, which take LTreeCollection as an argument, will also be useful.
Created by Korben Dallas.