public function arrayKeysSnakeRecursive($array)
    {
        $result = [];

        $array = arrayable($array) ? $array->toArray() : $array;

        array_walk($array, function ($value, $key) use (&$result) {
            $result[snake_case($key)] = arrayable($value) || is_array($value)
                ? $this->arrayKeysSnakeRecursive($value)
                : $value;
        });

        return coollect($result);
    }
public function arrayKeysSnakeRecursive($array)
    {
        $result = [];

        $array = arrayable($array) ? $array->toArray() : $array;

        array_walk($array, function ($value, $key) use (&$result) {
            $result[snake_case($key)] = arrayable($value) || is_array($value)
                ? $this->arrayKeysSnakeRecursive($value)
                : $value;
        });

        return coollect($result);
    }
public function arrayKeysSnakeRecursive ( $ array ) { $ result = [ ] ; $ array = arrayable ( $ array ) ? $ array -> toArray ( ) : $ array ; array_walk ( $ array , function ( $ value , $ key ) use ( & $ result ) { $ result [ snake_case ( $ key ) ] = arrayable ( $ value ) || is_array ( $ value ) ? $ this -> arrayKeysSnakeRecursive ( $ value ) : $ value ; } ) ; return coollect ( $ result ) ; }
Recursively change all array keys case.

@param array|\PragmaRX\Coollection\Package\Coollection $array
@return \PragmaRX\Coollection\Package\Coollection
Recursively change all array keys case .