PHPackages                             minhhn/collectionpackage - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. minhhn/collectionpackage

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

minhhn/collectionpackage
========================

Collection package

v1.4(3y ago)17MITPHPPHP &gt;=7.0

Since Sep 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/minh7721/collectionpackage)[ Packagist](https://packagist.org/packages/minhhn/collectionpackage)[ RSS](/packages/minhhn-collectionpackage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Collection Package PHP
======================

[](#collection-package-php)

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

[](#installation)

```
composer require minhhhn/collectionpackage:dev-main

```

Basic Usage
-----------

[](#basic-usage)

### Use composer autoloader

[](#use-composer-autoloader)

```
require_once __DIR__."/vendor/autoload.php";

use MinhHN\Collection\Data1;
use MinhHN\Collection\QueryBuilder\QueryBuilder;
use MinhHN\Collection\QueryBuilder\Connection;
```

### Init QueryBuilder with Connection::make()

[](#init-querybuilder-with-connectionmake)

```
$conn = Connection::make($database);
$query = new QueryBuilder($conn);
```

### Usage query builder

[](#usage-query-builder)

- Select all rows from a table

```
// Lấy ra tất cả giá trị trong bảng question (Truyền tên bảng vào select)
$array = $query->select('question')->all();
```

### Create collection

[](#create-collection)

```
// Khởi tạo collection
$collection = Data1::collection($array);
```

### Usage

[](#usage)

```
// Trả về tất cả giá trị của mảng
print_r($collection->all());
echo "\n\n";

// Tính trung bình
print_r($col/lection->avg('id'));
echo "\n\n";

// In ra tất cả giá trị của 1 cột
print_r($collection->pluck('content'));
echo "\n\n";

// Trả về số gấp đôi số cũ
$newAge = $collection->map(function ($item){
     return ($item->id)*2;
});
print_r($newAge);

// Tra ve so chan
$tuoiChan = $collection->filter(function ($var){
         return !($var->id & 1);
});
print_r($tuoiChan);

// Sap xep giam dan
print_r($collection->sortBy('id', 'desc'));
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

1352d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f2cbed74179f4b5d8cfaac946240fbbc65bc8b081864e9bfd0ac0eed9be07ec?d=identicon)[minh7721](/maintainers/minh7721)

---

Top Contributors

[![minh7721](https://avatars.githubusercontent.com/u/57635053?v=4)](https://github.com/minh7721 "minh7721 (35 commits)")

### Embed Badge

![Health badge](/badges/minhhn-collectionpackage/health.svg)

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

###  Alternatives

[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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