2017 © Pedro Peláez
 

library laravel-recursive-collection

A package to convert nested arrays and associative arrays into nested collections

image

designmynight/laravel-recursive-collection

A package to convert nested arrays and associative arrays into nested collections

  • Thursday, February 1, 2018
  • by StevePorter92
  • Repository
  • 4 Watchers
  • 3 Stars
  • 130 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 381 % Grown

The README.md

Laravel Recursive Collection

Latest Stable Version Total Downloads, (*1)

A service provider to add support for for converting nested arrays and associative arrays into laravel collections, (*2)

Table of contents

Installation

Installation using composer:, (*3)

composer require designmynight/laravel-recursive-collection

Laravel version Compatibility

Laravel Package
5.5.x 1.0.x

And add the service provider in config/app.php:, (*4)

DesignMyNight\Laravel\RecursiveCollectionServiceProvider::class,

For usage with Lumen, add the service provider in bootstrap/app.php., (*5)

$app->register(DesignMyNight\Laravel\RecursiveCollectionServiceProvider::class);

Example

$data = [
    [
        'name' => 'John Doe',
        'email' => 'john@doe.com',
        'bookings' => [
            [
                'venue' => 'Venue A',
                'date' => '2000-01-01'
                'guests' => 2
            ],
            [
                'venue' => 'Venue B',
                'date' => '2001-01-01'
                'guests' => 2
            ],
        ],
    ],
];

$collection = (new Collection($data))->recursive();
$collection = collect($data)->recursive(); // Shorthand

The Versions

01/02 2018

dev-master

9999999-dev https://github.com/designmynight/laravel-recursive-collection

A package to convert nested arrays and associative arrays into nested collections

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Porter

laravel collection designmynight laravel-collection laravel-recursive-collection

01/02 2018

v1.0.0

1.0.0.0 https://github.com/designmynight/laravel-recursive-collection

A package to convert nested arrays and associative arrays into nested collections

  Sources   Download

MIT

The Requires

 

The Development Requires

by Steve Porter

laravel collection designmynight laravel-collection laravel-recursive-collection