Download the PHP package ohhink/relation without Composer

On this page you can find all versions of the php package ohhink/relation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package relation

Laravel 层级关系扩展包

standard-readme compliant

English 中文

快速创建层级架构,可用于上下级明确,多层级的任意应用

本拓展包运行基础环境:

  1. Php >= 8.0
  2. Laravel Version >= 8.6

内容列表

背景

在实际开发中,经常会碰到多层级的组织架构。例如:

当Z向上找A,或者A向下找Z的时候,如果处理不当,任务的时间复杂度就会变成O(N)。

此拓展包可将上述情况的时间复杂度变为O(1),并提供相应接口,实现隐式调用。

安装

在项目根目录运行 composer

根目录下运行资源发布,此命令会增加配置文件(relationship.php)

根目录下运行数据库迁移填充命令

向 User 模型添加 HasRelationship Trait

至此,安装完毕

使用说明

方法名 居中对齐 示例
directChildren 获取直接下级 $user->directChildren
directParent 获取直接上级 $user->directParent
recursionChildren 已当前节点,向下生成树 $user->recursionChildren
sblings 获取兄弟节点 $user->sblings
allChildren 获取全部下级, asc 依次向下 / desc 从最底层往上 $user->allChildren() / User::allChildren(1, "asc")
allParents 获取全部上级, asc 依次向上 / desc 从最高层向下 $user->allParents() / User::allParents(5, "asc")
transfer 转移节点,成为目标节点的子节点 $user->transfer(1) / User::transfer(1, 5)
delNode 删除当前节点,用下级节点代替本级节点 $user->delNode() / User::delNode(1)
removeNode 删除当前节点及子节点 $user->removeNode() / User::removeNode(1)

维护者

@OhhInk.

如何贡献

非常欢迎你的加入! 有任何问题或者想要贡献代码,请提交 issue

使用许可

MIT © OhhInk


All versions of relation with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ohhink/relation contains the following files

Loading the files please wait ....