umbrellio/laravel-ltree
最新稳定版本:8.1.0
Composer 安装命令:
composer require umbrellio/laravel-ltree
包简介
Extension LTree (Postgres) for Laravel
README 文档
README
LTree Extension (PostgreSQL) for Laravel.
Installation
Run this command to install:
php composer.phar require umbrellio/laravel-ltree
How to use
Implement your Eloquent\Model from LTreeModelInterface and use LTreeModelTrait.
Use LTreeService for build path:
- when create model:
createPath(LTreeModelInterface $model) - when update model:
updatePath(LTreeModelInterface $model)for update path for model and children - 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 & LTreeResource, which take LTreeCollection as an argument, will also be useful.
Authors
Created by Korben Dallas.
统计信息
- 总下载量: 102.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 33
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 4
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-16