NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1479 most downloaded on Packagist
A set of useful Laravel collection macros
Latest stable
8.1.0
Last release 9 months ago
20 Feb 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
82 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Add Laravel 13 support
Add Laravel 13 support
Update README.md by @pikant in https://github.com/spatie/laravel-collection-macros/pull/254
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/8.0.1...8.0.2
Delete firstOrFail() macro by @jivanf in https://github.com/spatie/laravel-collection-macros/pull/253
Your coding agent can read these notes before it upgrades. Set up the MCP server →
firstOrFail() macro by @jivanf in https://github.com/spatie/laravel-collection-macros/pull/253Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/8.0.0...8.0.1
Laravel 12.x Compatibility by @laravel-shift in https://github.com/spatie/laravel-collection-macros/pull/252
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.14.2...8.0.0
fix: php 8.4 compatibility by @calebdw in https://github.com/spatie/laravel-collection-macros/pull/251
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.14.1...7.14.2
pluckMany dotted key support by @sfinktah in https://github.com/spatie/laravel-collection-macros/pull/248
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.14.0...7.14.1
Laravel 11.x Compatibility by @laravel-shift in https://github.com/spatie/laravel-collection-macros/pull/249
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.13.1...7.14.0
feat(collectBy): support dot-notation by @innocenzi in https://github.com/spatie/laravel-collection-macros/pull/247
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.13.0...7.13.1
add hasCaseSensitive and getCaseSensitive
hasCaseSensitive and getCaseSensitiveSfink pluck many values by @sfinktah in https://github.com/spatie/laravel-collection-macros/pull/242
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.12.4...7.12.5
Add max depth parameter for recursive macro by @Kyzegs in https://github.com/spatie/laravel-collection-macros/pull/240
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.12.3...7.12.4
- support L10
Fix warnings on running the test suite by @alexmanase in https://github.com/spatie/laravel-collection-macros/pull/238
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.12.1...7.12.2
Update containsAll description by @NilLlisterri in https://github.com/spatie/laravel-collection-macros/pull/233
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.12.0...7.12.1
Update .gitattributes by @angeljqv in https://github.com/spatie/laravel-collection-macros/pull/231
containsAny and containsAll by @freekmurze and @michaelnabil230Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.11.0...7.12.0
Add weightedRandom macro by @freekmurze in https://github.com/spatie/laravel-collection-macros/pull/224
weightedRandom macro by @freekmurze in https://github.com/spatie/laravel-collection-macros/pull/224Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.10.0...7.11.0
- support Laravel 9
Add path macro by @michael-rubel in https://github.com/spatie/laravel-collection-macros/pull/220
path macro by @michael-rubel in https://github.com/spatie/laravel-collection-macros/pull/220Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.8.0...7.9.0
Added recursive macro by @alexgarrettsmith in https://github.com/spatie/laravel-collection-macros/pull/218
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.7.0...7.8.0
Add if macro by @freekmurze in https://github.com/spatie/laravel-collection-macros/pull/217
if macro by @freekmurze in https://github.com/spatie/laravel-collection-macros/pull/217Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.6.0...7.7.0
Fix docblock indentation by @dwightwatson in https://github.com/spatie/laravel-collection-macros/pull/211
Full Changelog: https://github.com/spatie/laravel-collection-macros/compare/7.5.0...7.6.0
- add insertAt macro
insertAt macro (#209)- add pluckMany
pluckMany (#207)- add firstOrPush
firstOrPush- add getNth macro
- add support for PHP 8
- add support for Laravel 8
improve second, third, ... macros
use registry over file scan + string manipulation
drop support for PHP 7.3 and below
- add PHP 8 support
DO NOT USE: release was incorrectly tagged
DO NOT USE: release was incorrectly tagged
- Laravel 7 support
Renamed collect() macro to collectBy() to resolve Laravel 6 compatibility
collect() macro to collectBy() to resolve Laravel 6 compatibilityremove join method as the same implementation has been added to Laravel
join method as the same implementation has been added to Laravelfix paginate for pages other than 1
paginate for pages other than 1prioritize will keep the keys of the original item
prioritize will keep the keys of the original itemfix paginate for pages other than 1
paginate for pages other than 1- add support for Laravel 5.8
- add join macro
join macro- add head macro
head macroadd methods to get items by human named indexes
- parallels macro tests fix
parallels macro tests fixfirstOrFail will return the item instead of a collection
firstOrFail will return the item instead of a collectionrange macroFix maximum function nesting reached error in eachCons
eachConsAdded: Laravel 5.6 compatibility
- Added: pluckToArray
pluckToArraymake parallelMap return a new collection
parallelMap return a new collectionfix count warning/exception php7.2 in Transpose
Transposeallow worker pool of parallelMap to be configured
parallelMap to be configured- Added: parallelMap
parallelMap- Added: findOrFail
findOrFailFixed transpose when using an empty array
transpose when using an empty arraytranspose when using an ArrayableFixed transpose when passing a single-row matrix
transpose when passing a single-row matrix- Added: at
at- Added: rotate
rotate- Added: filterMap
filterMapAdded support for Laravel 5.5, removed support for older versions
glob macrodd and dump macrosgroupByModel and sectionBytail, eachCons, sliceBefore and chunkBy now have a $preserveKeys parameter
tail, eachCons, sliceBefore and chunkBy now have a $preserveKeys parameterAdd $itemsKey and $preserveKeys parameters to groupByModel
$itemsKey and $preserveKeys parameters to groupByModelOne column per quarter.