bitsnbolts/laravel-collection-macros
A set of useful Laravel collection macros
3,022
1
| Install | |
|---|---|
composer require bitsnbolts/laravel-collection-macros |
|
| Latest Version: | 3.0.0 |
| PHP: | ^7.1|^8.0|^8.1|^8.2|^8.3 |
| License: | MIT |
| Last Updated: | Dec 19, 2025 |
| Links: | GitHub · Packagist |
Maintainer: thijsvdanker
Laravel Collection Macros
This repository contains some useful collection macros.
Installation
You can install the package via composer:
composer require bitsnbolts/laravel-collection-macros
Usage
replaceInKeys
Do a find and replace on all the keys of the collection.
$data = new Collection(['foo_bar' => 1]);
$data->replaceInKeys('_', ' '); // Collection(['foo bar' => 1])
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
flagstudio/laravel-paginate
Different paginate macros for laravel eloquent builder and collection
9,089
15
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
637,827,751
9,703
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 3.0.0 | ^7.1| | 5.8.*| | MIT | |
| 2.6.0 | ^7.1| | 5.8.*| | MIT | |
| 2.5.0 | ^7.1| | 5.8.*| | MIT | |
| 2.4.0 | ^7.1| | 5.8.*| | MIT | |
| 2.3.0 | ^7.1| | 5.8.*| | MIT | |
| 2.2.0 | ^7.1 | 5.8.*| | MIT | |
| 2.1.0 | ^7.1 | 5.8.*| | MIT | |
| 2.0.0 | ^7.1 | 5.8.*| | MIT | |
| 1.1.0 | ^7.1 | 5.8.* | MIT | |
| 1.0.2 | ^7.1 | 5.7.* | MIT | |
| 1.0.1 | ^7.1 | 5.7.* | MIT | |
| 1.0.0 | ^7.1 | 5.7.* | MIT |