protected function buildColumnByCollection(array $row, Collection $columns, $type = 'printable')
    {
        $results = [];
        foreach ($columns->all() as $column) {
            if ($column[$type]) {
                $title = $column['title'];
                $data  = array_get($row, $column['data']);
                if ($type == 'exportable') {
                    $title    = $this->decodeContent($title);
                    $dataType = gettype($data);
                    $data     = $this->decodeContent($data);
                    settype($data, $dataType);
                }

                $results[$title] = $data;
            }
        }

        return $results;
    }
protected function buildColumnByCollection(array $row, Collection $columns, $type = 'printable')
    {
        $results = [];
        foreach ($columns->all() as $column) {
            if ($column[$type]) {
                $title = $column['title'];
                $data  = array_get($row, $column['data']);
                if ($type == 'exportable') {
                    $title    = $this->decodeContent($title);
                    $dataType = gettype($data);
                    $data     = $this->decodeContent($data);
                    settype($data, $dataType);
                }

                $results[$title] = $data;
            }
        }

        return $results;
    }
protected function buildColumnByCollection ( array $ row , Collection $ columns , $ type = 'printable' ) { $ results = [ ] ; foreach ( $ columns -> all ( ) as $ column ) { if ( $ column [ $ type ] ) { $ title = $ column [ 'title' ] ; $ data = array_get ( $ row , $ column [ 'data' ] ) ; if ( $ type == 'exportable' ) { $ title = $ this -> decodeContent ( $ title ) ; $ dataType = gettype ( $ data ) ; $ data = $ this -> decodeContent ( $ data ) ; settype ( $ data , $ dataType ) ; } $ results [ $ title ] = $ data ; } } return $ results ; }
Transform row column by collection.

@param array                          $row
@param \Illuminate\Support\Collection $columns
@param string                         $type
@return array
Transform row column by collection .