Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Collection Macros

Laravel Collection Macros Laravel Package

werxe/laravel-collection-macros

A handy set of macros that extends Laravel Collections with extra methods for common array and data transformations, letting you write cleaner, more expressive pipelines without custom helper functions or repetitive loops.

View on GitHub
Deep Wiki
Context7

Custom Laravel Collection Macros.

Frequently asked questions about Laravel Collection Macros
What is werxe/laravel-collection-macros and what does it do?
werxe/laravel-collection-macros is a Composer package that adds custom macros to Laravel Collections. It is designed for common array and data transformations so you can write cleaner collection pipelines instead of repetitive loops or custom helper functions. It fits Laravel applications that already use Collections as a standard transformation pattern.
How do I install werxe/laravel-collection-macros in Laravel?
Install the package with Composer, typically by requiring werxe/laravel-collection-macros at ^7.0. Integration is expected to be straightforward because Laravel package auto-discovery is likely supported. After installation, verify that the macros are registered and run your collection-heavy tests before deploying.
Does werxe/laravel-collection-macros support Laravel 8?
No, version 7.0.0 of the package makes Laravel 9.0 the minimum supported framework version. Teams still on Laravel 8 cannot use v7 without first upgrading Laravel. Existing v6 users should treat the upgrade as an infrastructure change gated by their Laravel version.
What Laravel and PHP versions are required by this package?
The package’s v7 release requires Laravel 9.0 or higher as the framework floor. The exact PHP version requirement is defined in the package composer.json and should be checked before adoption. Validate your application’s Laravel and PHP constraints against that file with Composer before merging.
Which collection macros does werxe/laravel-collection-macros register?
The package registers a set of custom Laravel Collection macros for common array and data transformations. The provided overview does not list every macro name, so review the package README and source code for the full inventory. Document the macro names your application relies on so future upgrades include them in compatibility checks.
Will these collection macros collide with my existing application or package macros?
Macro-name collisions are a real risk because Laravel Collection macros are registered globally. Inventory your existing custom and third-party collection macros before enabling this package. If names overlap, resolve the conflict or avoid adopting the conflicting macro before rolling out.
How do I upgrade werxe/laravel-collection-macros from v6 to v7?
Treat v7.0.0 as a breaking change only in its framework floor: Laravel 9.0 is now the minimum supported version. Confirm your application is on Laravel 9.0 or later before updating, then require ^7.0 in a branch and resolve Composer constraints. Run the full test suite and any collection-heavy integration tests before production rollout.
Does werxe/laravel-collection-macros work with Laravel Octane and long-running workers?
The package extends Laravel Collections through macros, which modify a core Laravel class globally. If your application uses Laravel Octane or long-running workers, verify that macro registration remains safe across workers in your environment. Test the integration under your actual worker model rather than assuming default behavior.
How should I test werxe/laravel-collection-macros in my Laravel application?
Run your full test suite, static analysis, and collection-heavy integration tests after adding or upgrading the package. Because macros are used broadly across application and test code, validation effort is moderate even though installation is low effort. A canary or staging deployment is also recommended before production rollout.
Is werxe/laravel-collection-macros safe for production or should I use custom helper functions?
The package is best suited to Laravel services that already model transformations through collection pipelines and want to avoid locally owned helper functions. Runtime overhead is expected to be negligible for typical use, but the main risks are version compatibility, macro-name collisions, and global behavior changes. Track the dependency against Laravel’s release cadence and assign ownership for Composer updates and macro inventory.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource