| Package Data | |
|---|---|
| Maintainer Username: | konsulting |
| Maintainer Contact: | keoghan@klever.co.uk (Keoghan Litchfield) |
| Package Create Date: | 2017-02-06 |
| Package Last Update: | 2025-07-28 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-03 15:23:53 |
| Package Statistics | |
|---|---|
| Total Downloads: | 6,487 |
| Monthly Downloads: | 78 |
| Daily Downloads: | 2 |
| Total Stars: | 2 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
A few extensions to the Laravel Collection and Arr.
composer require konsulting/laravel-extend-collections
If you are using Laravel 5.5, this package will auto-register the service provider.
However, if you have chosen not to auto-register, or are using an earlier version,
add the CollectionsServiceProvider to your config/app.php.
'providers' => [
// Other service providers...
Konsulting\Laravel\CollectionsServiceProvider::class,
],
There is a simple namespaced helper function to assist with extending Collection and Arr.
// Inside your application code, run:
\Konsulting\Laravel\load_collection_extensions();
fromDot - convert an array where the keys are dot-notation indexed to a nested arraydropEmpty - drop items whose values are empty()
deep - apply a function recursively through a collection, and through arrays/collections within itdotGet - retrieve an item using dot-notationdotSet - set an item using dot-notationdotHas - check if an item exists using dot-notationdot - convert a nested collection to dot-notation indexed collectionfromDot - convert a dot-notation indexed collection to a nested collectionContributions are welcome and will be fully credited. We will accept contributions by Pull Request.
Please:
We use PHPUnit
Run tests using PHPUnit: vendor/bin/phpunit