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)5103MITPHPPHP &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 1mo 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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

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

3339d 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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[lazerg/laravel-enum-pro

A powerful PHP enum extension with collection support, random selection, and magic static calls

4319.0k](/packages/lazerg-laravel-enum-pro)[werxe/laravel-collection-macros

Custom Laravel Collection macros.

2625.8k](/packages/werxe-laravel-collection-macros)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[prologue/support

Prologue Support is an extension for Illuminate Support

1616.8k](/packages/prologue-support)

PHPackages © 2026

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