PHPackages                             weiwenhao/tree-ql - 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. [API Development](/categories/api)
4. /
5. weiwenhao/tree-ql

ActiveLibrary[API Development](/categories/api)

weiwenhao/tree-ql
=================

laravel include

0.6.3-alpha(6y ago)1019111MITPHPPHP &gt;=7.1.0

Since Jan 21Pushed 2y ago5 watchersCompare

[ Source](https://github.com/weiwenhao/tree-ql)[ Packagist](https://packagist.org/packages/weiwenhao/tree-ql)[ RSS](/packages/weiwenhao-tree-ql/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (10)Used By (0)

English | [简体中文](https://github.com/weiwenhao/tree-ql/blob/master/README-CN.md)

What is tree-ql?
----------------

[](#what-is-tree-ql)

tree-ql is a **laravel extension** that builds a **highly descriptive**, readable, **high-performance** API with no redundancy through a **simple configuration**.

- **Will not invade laravel**, can be integrated into the existing laravel project at any time.
- **Will not invade RESTful** and further improve API descriptiveness based on RESTful.
- No matter how complex the API description, **no N + 1 problem** will occur.
- Tree-ql is not a set of API specifications, but a production environment solution that can **improve development efficiency**.
- **WYSIWYG**, the client can include the required resources according to their own needs without redundancy.

#### Basic description

[](#basic-description)

[![](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311113622.png)](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311113622.png)

#### Quick description

[](#quick-description)

[![](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311113711.png)](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311113711.png)

#### Complex description

[](#complex-description)

[![](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311114049.png)](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311114049.png)

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

[](#installation)

Make sure your laravel version is above 5.5 and execute in the project root directory

```
composer require weiwenhao/tree-ql
```

> The current version number &lt; 1.0.0, which belongs to the alpha version.

Document
--------

[](#document)

### include

[](#include)

You can see that the core of tree-ql is include, so what is the grammar rule of include?

[![](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311135637.png)](https://raw.githubusercontent.com/weiwenhao/pictures/main/history/20190311135637.png)

You can see that the include syntax is simpler, add two points.

- Both`.`and` {}` can represent hierarchical nesting relationships, which are syntactic sugars when only one field is nested in `{}`. If you need to nest multiple fields, use` {}`
- Hierarchical nesting is theoretically infinite (limited by the length of the url), of course, as long as you follow the syntax of tree-ql, no matter how deep the nesting, there will be no performance problems.

### Simple configuration

[](#simple-configuration)

I have been introducing the function and external performance of tree-ql. Now let me introduce the internal configuration of tree-ql. First, let's look at the configuration entry file.

```
# app/Resources/PostResource
