PHPackages                             beauty-framework/collection - 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. beauty-framework/collection

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

beauty-framework/collection
===========================

Beauty Collection

1.0.1(11mo ago)00MITPHPPHP &gt;=8.1

Since Jun 19Pushed 11mo agoCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Beauty Collection
=================

[](#beauty-collection)

A powerful collection abstraction for the Beauty Framework.
Supports both eager and lazy data pipelines, multiple storage strategies, method chaining (`map`, `filter`, `sortBy`, `paginate`, etc.), strict interfaces, and full compatibility.

---

Features
--------

[](#features)

### `Collection` (eager)

[](#collection-eager)

- Fluent methods:
    - `map`, `filter`, `where`, `sortBy`, `paginate`, `each`, `first`, `last`, `values`
- Implements:
    - `ArrayAccess`, `Countable`, `IteratorAggregate`, `JsonSerializable`
- Smart `last()` optimization (iterator or buffered strategy)
- Storage strategies:
    - `ArrayStorage` (default)
    - `DsMapStorage` (if `ext-ds` is available)

### `LazyCollection`

[](#lazycollection)

- Based on `Generator`
- Fluent methods:
    - `map`, `filter`, `chunk`, `flatMap`, `reduce`, `take`, `first`, `toArray`
- Memory efficient for large or infinite datasets

### Interfaces

[](#interfaces)

- `CollectionInterface`
- `SupportsOperations`
- `SupportsAccessors`
- `LazyCollectionInterface`

---

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

[](#installation)

```
composer require beauty-framework/collection
```

---

### Usage

[](#usage)

**Eager Collection**

```
$collection = new Collection([
  ['name' => 'Kirill'],
  ['name' => 'Hui'],
  ['name' => 'Zver'],
]);

$filtered = $collection
    ->where('name', 'Kirill')
    ->map(fn($x) => strtoupper($x['name']))
    ->toArray();
```

**Lazy Collection**

```
$collection = new LazyCollection(fn() => yield from range(1, 1_000_000));

$result = $collection
    ->filter(fn($x) => $x % 2 === 0)
    ->take(5)
    ->flatMap(fn($x) => [$x, $x * 10])
    ->toArray();
```

---

Tests
-----

[](#tests)

```
vendor/bin/phpunit
```

---

Compatibility
-------------

[](#compatibility)

- ArrayAccess
- Countable
- IteratorAggregate
- JsonSerializable

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Total

2

Last Release

333d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/068f8c26f06f513a9c38d2a01c4d90a85eae1125a5b9d14eae7059715be860e4?d=identicon)[m1n64](/maintainers/m1n64)

---

Top Contributors

[![m1n64](https://avatars.githubusercontent.com/u/24874264?v=4)](https://github.com/m1n64 "m1n64 (2 commits)")

---

Tags

collectionbeauty

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/beauty-framework-collection/health.svg)

```
[![Health](https://phpackages.com/badges/beauty-framework-collection/health.svg)](https://phpackages.com/packages/beauty-framework-collection)
```

###  Alternatives

[phpcollection/phpcollection

General-Purpose Collection Library for PHP

1.0k64.0M34](/packages/phpcollection-phpcollection)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[loophp/collection

A (memory) friendly, easy, lazy and modular collection class.

745663.8k13](/packages/loophp-collection)[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4561.2M5](/packages/athari-yalinqo)[lorisleiva/lody

Load files and classes as lazy collections in Laravel.

956.6M9](/packages/lorisleiva-lody)

PHPackages © 2026

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