Polyscope - The agent-first dev environment for Laravel

Collect

tightenco/collect image

Collect stats

Downloads
15.8M
Stars
1,495
Open Issues
2
Forks
107

View on GitHub →

Collect - Illuminate Collections as a separate package.

Collect - Illuminate Collections by Tighten

Overview

Collect is a Laravel package developed by Tighten Co. that allows you to integrate Laravel's Collections into non-Laravel PHP projects with ease. It provides the essential functionality of Laravel's Illuminate\Support\Collection class without requiring the entire Illuminate\Support package. This makes it lightweight and perfect for projects needing advanced collection operations outside of the Laravel ecosystem.

Main Features

  • Lightweight Integration: Use Laravel's Collections without the need for the entire Laravel support package.
  • Automatic Updates: Stays in sync with Laravel's Collections, ensuring consistency and reliability.
  • Developer Friendly: Includes an upgrade script for easy updates to mirror new Laravel releases.

Installation

Use Composer to install Collect in your project:

composer require tightenco/collect

Usage

Primarily, Collect is used in the same way as Laravel's Collections. Once installed, it can be utilized to leverage advanced collection methods in non-Laravel PHP applications.

Development and Testing

  • Upgrading: To upgrade Collect to a new version of Laravel's Collections, use the provided upgrade script:

    ./upgrade.sh # Automatically upgrades to the latest Laravel release
    ./upgrade.sh 5.7.10 # Upgrades to a specific Laravel version

    Ensure wget is installed on your system to use the upgrade script.

  • Testing: Run tests using PHPUnit after upgrading:

    vendor/bin/phpunit

Deprecation Notice

With the release of illuminate/collections, the Collect package is deprecated. It will only receive updates for Laravel versions 8.0 and 9.0 for package maintainers' convenience. Future projects should consider using the official illuminate/collections package.

FAQ

  • Collect will not develop independently from Illuminate's Collections and is designed to remain aligned with Laravel's implementation.
  • The choice of tightenco/collect over illuminate/collect is to avoid confusion with official Laravel packages.

This package is ideal for developers looking to utilize Laravel's powerful collection manipulation features outside of the Laravel framework itself, providing streamlined, efficient handling of array data.

tighten photo

We're not here anymore! We're at github.com/tighten

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Tightenco Collect Related Articles

Building your website using Jigsaw image

Building your website using Jigsaw

Read article
Eloquent Encrypted Casting image

Eloquent Encrypted Casting

Read article
The Static Site Generator Jigsaw Launched V1.0 image

The Static Site Generator Jigsaw Launched V1.0

Read article
Easily Test Email with MailThief image

Easily Test Email with MailThief

Read article
Use Collections outside Laravel image

Use Collections outside Laravel

Read article
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Celebian logo

Celebian

Celebian is a social media marketing agency specializing in helping their clients go viral on TikTok. Whether you're looking to reach a bigger audience or gain more Tiktok followers, likes, and views, they've got you covered.

Celebian
CodeKudu logo

CodeKudu

Stand-ups, Retrospectives, and 360° Feedback for the entire team. 50% off with code LARAVELNEWS.

CodeKudu