PHPackages                             azhida/laravel-tools - 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. azhida/laravel-tools

ActiveLibrary

azhida/laravel-tools
====================

收集整理常用方法

0.2.0(4y ago)034MITPHP

Since Aug 31Pushed 4y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

 laravel-tools
===============

[](#-laravel-tools-)

 收集整理常用方法.

Installing
----------

[](#installing)

```
$ composer require azhida/laravel-tools -vvv
```

###### 发布迁移文件

[](#发布迁移文件)

```
$ php artisan vendor:publish
# 选择 Azhida\LaravelTools\ServiceProvider
```

###### 执行迁移文件

[](#执行迁移文件)

```
$ php artisan migrate --path=database/migrations/2021_08_31_091229_create_test_binary_trees_table.php
$ php artisan migrate --path=database/migrations/2021_08_31_092504_create_test_binary_tree_max_depths_table.php
```

Usage
-----

[](#usage)

#### 常用方法：

[](#常用方法)

- Tool::arrayToTree() 一维数组转树形结构

#### 封装几个标准二叉树的操作方法：

[](#封装几个标准二叉树的操作方法)

###### 添加节点

[](#添加节点)

```
// 添加一个节点
TestBinaryTree::addNode_first()

// 添加单个子节点
TestBinaryTree::addNode(TestBinaryTree $parent, $leg_of_parent, $show_info = []);

// 批量添加子节点 -- 指定节点指定边
TestBinaryTree::addNodes_y($id, $leg, $depth = 1, $start_time = '');

// 批量添加子节点 -- 从指定节点下一层开始添加，添加顺序为 depth asc ，id asc
TestBinaryTree::addNodes_x($id, $depth = 10);

```

###### 获取节点

[](#获取节点)

```
// 获取ID节点下可添加的点位 -- 自上而下，从左到右
TestBinaryTree::searchAddEnableNodeById_DepthAsc_LToR($id);

// 获取ID节点下可添加的点位 -- 左腿【右腿】最底部
TestBinaryTree::searchAddEnableNodeById_Leg_MaxDepth($id, $leg = 'L');

// 获取ID的所有上级
TestBinaryTree::getParentsById($id);

// 获取ID所有子节点
TestBinaryTree::getSonsById($id, $depth = 10);

// 判断 A、D 两个节点是否存在祖孙关系
TestBinaryTree::isAncestor_AD($ancestor_id, $descendant_id);

```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/azhida/laravel-tools/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/azhida/laravel-tools/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~15 days

Recently: every ~23 days

Total

7

Last Release

1621d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f76b583f1640481d54dd9bc65b9dcec49be6b4f5884484e9357c053175c1508f?d=identicon)[azhida](/maintainers/azhida)

---

Top Contributors

[![azhida](https://avatars.githubusercontent.com/u/22959926?v=4)](https://github.com/azhida "azhida (15 commits)")

### Embed Badge

![Health badge](/badges/azhida-laravel-tools/health.svg)

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

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[drevops/git-artifact

Package artifact from your codebase in CI and push it to a separate git repo.

2133.2k](/packages/drevops-git-artifact)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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