PHPackages                             venveo/craft-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. venveo/craft-collections

Abandoned → [venveo/craft-collections](/?search=venveo%2Fcraft-collections)ArchivedCraft-plugin[Utility &amp; Helpers](/categories/utility)

venveo/craft-collections
========================

Use Laravel Collections in Craft CMS Plugins

v1.0.0(10y ago)10151PHP

Since Apr 27Pushed 9y ago7 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Use Laravel Collections in Craft CMS Plugins
============================================

[](#use-laravel-collections-in-craft-cms-plugins)

[Collections is a really powerful Laravel class](https://laravel.com/docs/master/collections) that provides "a fluent, convenient wrapper for working with arrays of data". Don't just take our words for it, Adam Watham is working on a book called "[Refactoring to Collections](http://adamwathan.me/refactoring-to-collections/)" and he also has a [great screencast on using collections](http://adamwathan.me/2015/01/01/refactoring-loops-and-conditionals/)..

There are often times when we are working with Craft CMS and wish we had Collections support, so we decided to build this plugin!

Requirements
------------

[](#requirements)

- [Craft 2.5+](https://craftcms.com/)

Installation and Setup
----------------------

[](#installation-and-setup)

1. Download [plugin release from this page](https://github.com/venveo/craft-collections/releases)
2. Rename the download directory to `collections` and move into your `plugins` directory
3. Install Collections from the control panel settings

Example Usage
-------------

[](#example-usage)

When working with data that is in an array...

```
$array = [
    'eight', 'six', 'seven', 'five'
];

```

You can easily make the array a Collection using the following code:

```
$collection = craft()->collections->make($array);

```

Once you have your data in a Collection, you can instantly reap the rewards!

For example you can get the count of items in the array/Collection by simply calling:

```
$collection->count();

```

Wham-o! the count, in this case `4`, will be easily available!

What if you need to ensure that an array contains and item?

```
if ($collection->contains('six')) {
   // returns true, then do something about it!
}

```

For the complete list of options when using Collections, see the list of [available methods](https://laravel.com/docs/master/collections#available-methods).

Credits
-------

[](#credits)

- [Jason McCallister](https://github.com/themccallister)
- [Carlo Latiano](https://github.com/carlolaitano)

About Venveo
------------

[](#about-venveo)

Venveo is a Digital Marketing Agency for Building Materials Companies in Blacksburg, VA. Learn more about us on [our website](https://www.venveo.com).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

3663d ago

Major Versions

v0.1.0 → v1.0.02016-04-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/c06cc90c1a7f274f31233258cedf58df05f581a0c1a79f44b40764a60b96f377?d=identicon)[ransom](/maintainers/ransom)

---

Top Contributors

[![jasonmccallister](https://avatars.githubusercontent.com/u/5354908?v=4)](https://github.com/jasonmccallister "jasonmccallister (15 commits)")

---

Tags

craftcmslaravellaravel-collectionsplugin

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M858](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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