src/Arr.php
public static function fromRecursive($iterable)
    {
        $arr = static::from($iterable);

        foreach ($arr as $key => $value) {
            if ($value instanceof \stdClass || \is_iterable($value)) {
                $value = static::fromRecursive($value);
            }
            $arr[$key] = $value;
        }

        return $arr;
    }
public static function fromRecursive($iterable)
    {
        $arr = static::from($iterable);

        foreach ($arr as $key => $value) {
            if ($value instanceof \stdClass || \is_iterable($value)) {
                $value = static::fromRecursive($value);
            }
            $arr[$key] = $value;
        }

        return $arr;
    }
Recursively converts an `iterable` to nested arrays.

@param iterable|null|\stdClass $iterable

@return array