PHP code example of daikazu / laravel-recursive-collection

1. Go to this page and download the library: Download daikazu/laravel-recursive-collection library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

daikazu / laravel-recursive-collection example snippets


Daikazu\Laravel\RecursiveCollectionServiceProvider::class,

$data = [
    "foo" => "bar",
    "a"   => [1, 2, 3],
    "b"   => [
        [1, 2, 3],
        [
            "4" => "",
            "5" => "",
            "3" => "",
        ],
    ],
];

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