PHPackages                             ninhtqse/bruno - 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. ninhtqse/bruno

ActiveLibrary

ninhtqse/bruno
==============

1.4(2y ago)112.0kMITPHP

Since Apr 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ninhtqse/bruno)[ Packagist](https://packagist.org/packages/ninhtqse/bruno)[ RSS](/packages/ninhtqse-bruno/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

Bruno
=====

[](#bruno)

[![Latest Version](https://camo.githubusercontent.com/1c57710dabfeefe275f00f0288bb06e14eda004dbfd0733b84249415ecd1b3a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e696e68747173652f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ninhtqse/bruno/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/d41d0bc3afc3ff5e6f18d90011faa2c51a9355579ef1481463968713f7260a11/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e696e68747173652f6e696e68747173652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ninhtqse/bruno)[![Coverage Status](https://camo.githubusercontent.com/93f104a730718abfc399b4ee737a041aaadf17c9ccb8613773d9e9ab082aa390/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6e696e68747173652f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/ninhtqse/bruno)[![Total Downloads](https://camo.githubusercontent.com/a7b707f812e69ea6ee5deb264dc56fe1e63ce9cee7ab1dc8f8693c55d0f30ffa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e696e68747173652f6272756e6f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ninhtqse/bruno)

Giới thiệu
----------

[](#giới-thiệu)

Sử dụng với chức năng phân trang, sort, query tại client,...

**Dành riêng cho Bruno**

Gói này được đặt theo tên anh hùng Giordano Bruno. Một người nhìn xa trông rộng thực sự, người dám ước mơ xa hơn những gì người ta nghĩ có thể. Vì những ý tưởng của mình và việc từ chối từ bỏ chúng, ông đã bị thiêu sống vào năm 1600. [Tôi thực sự giới thiệu phim hoạt hình ngắn này về cuộc đời của anh ấy do Neil deGrasse Tyson thuật lại](https://vimeo.com/89241669).

Chức năng
---------

[](#chức-năng)

- Phân tích cú pháp các thông số GET để tải động các tài nguyên liên quan, sắp xếp và phân trang
- Lọc tài nguyên nâng cao bằng cách sử dụng nhóm bộ lọc
- Sử dụng [ninhtqse\\architect](https://github.com/ninhtqse/architect) để tải bên ngoài, tải id hoặc tải nhúng các tài nguyên liên quan

Cài đặt
-------

[](#cài-đặt)

```
composer require ninhtqse/bruno
```

### Các tham số truy vấn có sẵn

[](#các-tham-số-truy-vấn-có-sẵn)

Từ khóaKiểuMô tảIncludesarrayMảng tài nguyên liên kết để tải, e.g. \['author', 'publisher', 'publisher.books'\]SortarrayThuộc tính sắp xếp theo, e.g. 'title'LimitintegerGiới hạn tài nguyên để trả lạiPageintegerĐể sử dụng có giới hạnFilter\_groupsarrayMảng các nhóm bộ lọc. Xem bên dưới để biết cú pháp.FieldsarrayNhận các trường theo các tham số được truyền vào.SkipintegerVị trí bắt đầu nằm trong cơ sở dữ liệuTakeintegerSố lượng bản ghi muốn lấyNot\_fieldsbooleanTrừ các trường còn lại lấy hếtFilter\_orbooleanDùng đi kèm với Filter\_groups dùng để thay đổi điều kiện and/orSử dụng
-------

[](#sử-dụng)

=======================**Includes**=======================

- Dùng để lấy ra dữ liệu của các bảng liên kết
- Ví dụ bảng users liên kết 1 nhiều với bảng blogs

VD:

```
localhost/users?includes[]=blogs

```

- Có thể includes nhiều bảng khác nhau, nếu là (1 - nhiều) sẽ có s đằng sau tên bảng : VD:

```
localhost/users?includes[]=blogs&includes[]=options

```

=======================**Sort**=======================

- Dùng để sắp xếp dữ liệu theo các trường
- Có 2 giá trị cần truyền vào sort
- Có thể truyền nhiều trường để sort

**Tham số**

Tên trườngGiá trịMô tảkeystringTên trườngdirectionASC or DESCKiểu sắp xếp**Ví dụ**

```
[
    {
        "key": "title",
        "direction": "ASC"
    }, {
        "key": "year",
        "direction": "DESC"
    }
]
```

VD:

```
localhost/users?sort[0][key]=title&sort[0][direction]=asc&sort[1][key]=title&sort[1][direction]=asc

```

=======================**Limit**=======================

- Dùng để lấy ra số bản ghi nhất định

VD:

```
localhost/users?limit=10

```

=======================**Page**=======================

- Dùng để phân trang . Page bắt buộc phải đi với limit

VD: Tổng có 50 bản ghi nhưng mỗi trang chỉ lấy 10 bản ghi =&gt; có 5 trang. Page là số từ 1-&gt;5

```
localhost/users?limit=10&page=2

```

=======================**Filter\_groups**=======================

- Dùng để query phía client
- Filter\_groups có 4 tham số

**Tham số**

TrườngKiểu dữ liệuMô tảkeystringTrường trong bảngvaluemixedGiá trịoperatorstringToán tửnotbooleanPhủ nhận bộ lọc**Toán tử**

KiểuMô tảVí dụctChuỗi chứa`ior` matches `Giordano Bruno` and `Giovanni`swBắt đầu với`Gior` matches `Giordano Bruno` but not `Giovanni`ewKết thúc với`uno` matches `Giordano Bruno` but not `Giovanni`eqBằng`Giordano Bruno` matches `Giordano Bruno` but not `Bruno`gtLớn hơn`1548` matches `1600` but not `1400`gteLớn hơn hoặc bằng`1548` matches `1548` and above (ony for Laravel 5.4 and above)lteNhỏ hơn hoặc bằng`1600` matches `1600` and below (ony for Laravel 5.4 and above)ltÍt hơn`1600` matches `1548` but not `1700`inCó tồn tại trong mảng`['Giordano', 'Bruno']` matches `Giordano` and `Bruno` but not `Giovanni`btGiữa`[1, 10]` matches `5` and `7` but not `11`eqdSo sánh ngày tháng năm2022-01-21 - Dùng để filter các trường là datetimeeqySo sánh năm2022eqmSo sánh tháng01**Giá trị đặc biệt**

Giá trịMô tảnull (string)Thuộc tính sẽ được kiểm tra giá trị NULL(empty string)Thuộc tính sẽ được kiểm tra giá trị NULL```
[
    [
        "filters" => [
            [
                "key" => "acreage"
                "operator" => "bt"
                "value" => "[101,200]"
                "not" => false
            ]
        ]
        "or" => false
    ]
]

```

VD:

```
localhost/users?filter_groups[0][filters][1][key]=hierarchy&filter_groups[0][filters][1][operator]=eq&filter_groups[0][filters][1][value]=13&filter_groups[1][filters][1][key]=floor_plan&filter_groups[1][filters][1][operator]=eq&filter_groups[1][filters][1][value]=1LDK

```

SQL:

```
select * from `rooms` where (`rooms`.`hierarchy` = 13) and (`rooms`.`floor_plan` = 1LDK)

```

- Trường filter\_groups\[0\] là dấu ngoặc đầu tiên của câu lệnh SQL bên trên | trường filter\_groups\[1\] là dấu ngoặc thứ 2 sau and
- Mạc định giữa các ngoặc lớn sẽ là điều kiện sẽ là and
- Các mảng nhỏ trong trường filters sẽ nằm trong ngoặc lớn VD:

```
localhost/users?filter_groups[0][filters][1][key]=hierarchy&filter_groups[0][filters][1][operator]=eq&filter_groups[0][filters][1][value]=13&filter_groups[0][filters][2][key]=floor_plan&filter_groups[0][filters][2][operator]=eq&filter_groups[0][filters][2][value]=1LDK

```

SQL:

```
select * from `rooms` where (`rooms`.`hierarchy` = 13 and `rooms`.`floor_plan` = 1LDK)

```

- Trường not: Nếu bằng true sẽ (phủ định|ngược lại) của toán tử (operator)
- Với các trường nhỏ bên trong filters. Sử dụng or để đổi lại toán tử =&gt; Mạc định là and

=======================**Filter\_or**=======================

Sử dụng bắt buộc phải có filter\_groups

- Như đã nói bên trên "Mạc định giữa các ngoặc lớn sẽ là điều kiện sẽ là and"
- Nếu muốn là or ta truyền :

VD:

```
localhost/users?filter_groups[0][filters][1][key]=hierarchy&filter_groups[0][filters][1][operator]=eq&filter_groups[0][filters][1][value]=13&filter_groups[1][filters][1][key]=floor_plan&filter_groups[1][filters][1][operator]=eq&filter_groups[1][filters][1][value]=1LDK&filter_or[0]=true

```

SQL:

```
select * from `rooms` where (`rooms`.`hierarchy` = 13) or (`rooms`.`floor_plan` = 1LDK)

```

=======================**Fields**=======================

Sử dụng để lấy ra các trường cần thiết

- Ví dụ có 100 trường nhưng chỉ lấy 1 trường

```
localhost/users?fields[]=name&fields[]=test

```

=======================**Skip**=======================

Sử dụng để lấy ra vị trí trong sql | bắt buộc phải đi với take

- Ví dụ lấy ra 10 bản ghi dùng skip để lấy từ bản ghi số 5 trở đi

```
localhost/users?skip=5&take=10

```

=======================**Take**=======================

Sử dụng để lấy ra số bản ghi mong muốn

- Ví dụ lấy ra 10

```
localhost/users?take=10

```

=======================**Not\_fields**=======================

Sử dụng để loại bỏ các bản ghi không cần thiết

- VD bảng có 100 trường lấy 99 trường
- Nếu dùng fields phải liệt kê quá nhiều

```
localhost/users?not_fields[]=name

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~203 days

Total

5

Last Release

1024d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/996243095229cccc7202a11464dd63fc8b9a0f7b29e10219f1f285ac3c68df22?d=identicon)[ninhtqse](/maintainers/ninhtqse)

---

Top Contributors

[![ninhtqse](https://avatars.githubusercontent.com/u/64245514?v=4)](https://github.com/ninhtqse "ninhtqse (43 commits)")[![esbenp](https://avatars.githubusercontent.com/u/934819?v=4)](https://github.com/esbenp "esbenp (38 commits)")[![quyenhd](https://avatars.githubusercontent.com/u/41724437?v=4)](https://github.com/quyenhd "quyenhd (14 commits)")[![pmccarren](https://avatars.githubusercontent.com/u/4959702?v=4)](https://github.com/pmccarren "pmccarren (13 commits)")[![Carghaez](https://avatars.githubusercontent.com/u/297838?v=4)](https://github.com/Carghaez "Carghaez (10 commits)")[![ninhstrongly](https://avatars.githubusercontent.com/u/36351499?v=4)](https://github.com/ninhstrongly "ninhstrongly (3 commits)")[![yeexel](https://avatars.githubusercontent.com/u/2012693?v=4)](https://github.com/yeexel "yeexel (2 commits)")[![ninhtq-amela](https://avatars.githubusercontent.com/u/117244125?v=4)](https://github.com/ninhtq-amela "ninhtq-amela (1 commits)")[![sureshamk](https://avatars.githubusercontent.com/u/3139449?v=4)](https://github.com/sureshamk "sureshamk (1 commits)")[![trinhphuong](https://avatars.githubusercontent.com/u/27394213?v=4)](https://github.com/trinhphuong "trinhphuong (1 commits)")

### Embed Badge

![Health badge](/badges/ninhtqse-bruno/health.svg)

```
[![Health](https://phpackages.com/badges/ninhtqse-bruno/health.svg)](https://phpackages.com/packages/ninhtqse-bruno)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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