PHPackages                             itsmeabde/collections - 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. itsmeabde/collections

ActiveLibrary

itsmeabde/collections
=====================

The standalone version of laravel's collection for use outside of Laravel.

02PHP

Since Jul 21Pushed 5y agoCompare

[ Source](https://github.com/itsmeabde/collections)[ Packagist](https://packagist.org/packages/itsmeabde/collections)[ RSS](/packages/itsmeabde-collections/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Collection
==========

[](#collection)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/4153a604f296ad6f70832f1666eda48abdfb9172ec243c27fc136597ab84657d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6974736d65616264652f636f6c6c656374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itsmeabde/collections)

The standalone version of [Laravel's Collection](https://laravel.com/docs/5.8/collections) including [Arr &amp; Str helpers](https://laravel.com/docs/5.8/helpers) for use outside of Laravel.

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

[](#installation)

Install using composer:

```
composer require itsmeabde/collections
```

Usage
-----

[](#usage)

Create a collection instance

```
use Itsmeabde\Collections\Collection;

$data = new Collection([
    10 => ['user' => 1, 'skill' => 1, 'roles' => ['Role_1', 'Role_3']],
    20 => ['user' => 2, 'skill' => 1, 'roles' => ['Role_1', 'Role_2']],
    30 => ['user' => 3, 'skill' => 2, 'roles' => ['Role_1']],
    40 => ['user' => 4, 'skill' => 2, 'roles' => ['Role_2']],
]);

$result = $data->groupBy([
    'skill',
    function ($item) {
        return $item['roles'];
    },
], $preserveKeys = true);

/*
[
    1 => [
        'Role_1' => [
            10 => ['user' => 1, 'skill' => 1, 'roles' => ['Role_1', 'Role_3']],
            20 => ['user' => 2, 'skill' => 1, 'roles' => ['Role_1', 'Role_2']],
        ],
        'Role_2' => [
            20 => ['user' => 2, 'skill' => 1, 'roles' => ['Role_1', 'Role_2']],
        ],
        'Role_3' => [
            10 => ['user' => 1, 'skill' => 1, 'roles' => ['Role_1', 'Role_3']],
        ],
    ],
    2 => [
        'Role_1' => [
            30 => ['user' => 3, 'skill' => 2, 'roles' => ['Role_1']],
        ],
        'Role_2' => [
            40 => ['user' => 4, 'skill' => 2, 'roles' => ['Role_2']],
        ],
    ],
];
*/
```

Alternatively you can use the shorthand method `collect`:

```
$collection = collect([1, 2, 3, 4, 5]);

$multiplied = $collection->map(function ($item, $key) {
    return $item * 2;
});

$multiplied->all();

// [2, 4, 6, 8, 10]
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![itsmeabde](https://avatars.githubusercontent.com/u/21280766?v=4)](https://github.com/itsmeabde "itsmeabde (7 commits)")

### Embed Badge

![Health badge](/badges/itsmeabde-collections/health.svg)

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

PHPackages © 2026

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