bitsnbolts / laravel-collection-macros
A set of useful Laravel collection macros
Installs: 2 907
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^7.1|^8.0|^8.1|^8.2
- illuminate/support: 5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: 3.7.*|^4.0|^7.7|^8.5.9|^9.0
- phpunit/phpunit: ^8.0|^9.5|^10.0|^11.0
README
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.