PHP Package: spatie/laravel-collection-macros

Enhance Laravel collections with useful macros for efficient data manipulation and transformation.

Current Version: 8.0.0
Last Updated: 2025-02-17
PHP Requirement: ^8.2
Dependencies:
illuminate/support
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

Spatie's Laravel Collection Macros is a powerful library that extends Laravel collections with custom macros, enabling developers to streamline data processing, filtering, and modifications. With a wide array of functions, developers can effortlessly handle complex data structures, improving code readability and maintainability. This library simplifies common tasks such as grouping, filtering, and sorting data, reducing development time and effort.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 8.0.1

Download Download v8.0.1

Previous Versions

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/spatie/laravel-collection-macros/8.0.1/loader.php';
require_once 'libs/illuminate/support/12.33.0/loader.php';

use Spatie\CollectionMacros\CollectionMacroServiceProvider;
use Illuminate\Support\Collection;

$obj = new CollectionMacroServiceProvider();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.