PHPackages                             webdevcave/collections - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. webdevcave/collections

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webdevcave/collections
======================

A PHP library for managing collections of data with support for nested keys.

00PHP

Since May 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/WebdevCave/collections-php)[ Packagist](https://packagist.org/packages/webdevcave/collections)[ RSS](/packages/webdevcave-collections/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Collection Class
================

[](#collection-class)

The Collection class represents a collection of data with support for nested keys.

Installation
------------

[](#installation)

You can install the Collection class via Composer:

```
composer require webdevcave/collections
```

Usage
-----

[](#usage)

Instantiate the Collection class with an optional array of initial data:

```
use WebdevCave\Collections\Collection;

$collection = new Collection([
    'user' => [
        'name' => 'John Doe',
        'email' => 'john@example.com',
        'address' => [
            'city' => 'New York',
            'country' => 'USA'
        ]
    ]
]);
```

Access nested data using dot notation:

```
$city = $collection->get('user.address.city'); // Returns 'New York'
```

Check if a nested key exists:

```
$hasCountry = $collection->has('user.address.country'); // Returns true
```

Set a value for a nested key:

```
$collection->set('user.address.postal_code', '10001');
```

Delete a key and its value:

```
$collection->delete('user.address.city');
```

Clear the collection:

```
$collection->clear();
```

Contributing
------------

[](#contributing)

Bug reports, suggestions and pull requests are welcome on GitHub.

License
-------

[](#license)

The class is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

11

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5069326?v=4)[Carlos Alberto Bertholdo Carucce](/maintainers/carloscarucce)[@carloscarucce](https://github.com/carloscarucce)

---

Top Contributors

[![carloscarucce](https://avatars.githubusercontent.com/u/5069326?v=4)](https://github.com/carloscarucce "carloscarucce (12 commits)")

---

Tags

arraycollectiondatahelperlibrarynested-keyspackagephputilityutility-classes

### Embed Badge

![Health badge](/badges/webdevcave-collections/health.svg)

```
[![Health](https://phpackages.com/badges/webdevcave-collections/health.svg)](https://phpackages.com/packages/webdevcave-collections)
```

###  Alternatives

[outl1ne/nova-grid

A Laravel Nova tool that allows placing fields in a grid using -&gt;size() helpers.

1017.6k](/packages/outl1ne-nova-grid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
