PHPackages                             thomhurks/laravel-collection-extensions - 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. thomhurks/laravel-collection-extensions

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

thomhurks/laravel-collection-extensions
=======================================

Extensions for Laravel's Collection class. Notably groupByMultiple for grouping collections on multiple fields instead of just one.

v1.0.1(9y ago)5104MITPHPPHP &gt;=5.6.29

Since Mar 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ThomHurks/laravel-collection-extensions)[ Packagist](https://packagist.org/packages/thomhurks/laravel-collection-extensions)[ RSS](/packages/thomhurks-laravel-collection-extensions/feed)WikiDiscussions master Synced 3w ago

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

laravel-collection-extensions
=============================

[](#laravel-collection-extensions)

Extensions for Laravel's Collection class. Notably groupByMultiple for grouping collections on multiple fields instead of just one.

**Example:**

ABCDfoobarbazthudfoogarplycorgeplughfoobarcorgethudfoobarcorgewaldoquxgarplyxyzzyfredquxgraultgarplyquuzBy calling myCollection-&gt;groupBy(\['A', 'B', 'C', 'D'\]) the result would become:

- foo
    - bar
        - baz
            - thud \[foo, bar, baz, thud\]
        - corge
            - thud \[foo, bar, corge, thud\]
            - waldo \[foo, bar, corge, waldo\]
    - garply
        - corge
            - plugh \[foo, garply, corge, plugh\]
- qux
    - garply
        - xyzzy
            - fred \[quz, garply, xyzzy, fred\]
    - grault
        - garply
            - quuz \[qux, grault, garply, quuz\]

**Cross compatibility**The groupByMultiple function is somewhat compatible with Laravel's original groupBy in that it functions in the same way if you pass as first argument something that is not an array, so just like groupBy you can call it with a string or a closure. The function just puts the first argument in an array if it isn't one. If you try to pass a callable as an array, so \["Foo", "Bar"\] where Foo::Bar() is a valid method, then of course the groupByMultiple function will just attempt to group on the key "Foo" first and "Bar" second; this is the main incompatibility with groupBy(). Of course you can pass an array with a callable in it, so \[\["Foo", "Bar"\]\] or \[\["Foo", "Bar"\], "Baz"\] would work just fine. For people already using groupBy, this function will be very easy to switch to.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

3384d ago

PHP version history (2 changes)v1.0PHP ^5.6

v1.0.1PHP &gt;=5.6.29

### Community

Maintainers

![](https://www.gravatar.com/avatar/26831417fd89decf1e63730cb3617dfe48eec5d073f3f30245a5264751354ef7?d=identicon)[ThomHurks](/maintainers/ThomHurks)

---

Top Contributors

[![ThomHurks](https://avatars.githubusercontent.com/u/6796124?v=4)](https://github.com/ThomHurks "ThomHurks (5 commits)")

---

Tags

collectionsgroupbygroupingilluminate-collectionslaravellaravel-packagelaravel5-packagephpphp-librarylaravelcollectiongroupBygroupByMultiplelaravel-collection-extensionsthomhurks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thomhurks-laravel-collection-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/thomhurks-laravel-collection-extensions/health.svg)](https://phpackages.com/packages/thomhurks-laravel-collection-extensions)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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