function flatten(int $depth = 0) {
        $data = $this->flattenDo($this->data, $depth);
        return (new self($data));
    }
function flatten(int $depth = 0) {
        $data = $this->flattenDo($this->data, $depth);
        return (new self($data));
    }
function flatten ( int $ depth = 0 ) { $ data = $ this -> flattenDo ( $ this -> data , $ depth ) ; return ( new self ( $ data ) ) ; }
Flattens a multi-dimensional collection into a single dimension. Returns a new Collection.
@param int  $depth
@return \CharlotteDunois\Collect\Collection
Flattens a multi - dimensional collection into a single dimension . Returns a new Collection .