private function toColumnsCollection(array $columns)
    {
        $collection = collect();
        foreach ($columns as $column) {
            if (isset($column['data'])) {
                $column['title'] = $column['title'] ?? $column['data'];
                $collection->push(new Column($column));
            } else {
                $data          = [];
                $data['data']  = $column;
                $data['title'] = $column;
                $collection->push(new Column($data));
            }
        }

        return $collection;
    }
private function toColumnsCollection(array $columns)
    {
        $collection = collect();
        foreach ($columns as $column) {
            if (isset($column['data'])) {
                $column['title'] = $column['title'] ?? $column['data'];
                $collection->push(new Column($column));
            } else {
                $data          = [];
                $data['data']  = $column;
                $data['title'] = $column;
                $collection->push(new Column($data));
            }
        }

        return $collection;
    }
private function toColumnsCollection ( array $ columns ) { $ collection = collect ( ) ; foreach ( $ columns as $ column ) { if ( isset ( $ column [ 'data' ] ) ) { $ column [ 'title' ] = $ column [ 'title' ] ?? $ column [ 'data' ] ; $ collection -> push ( new Column ( $ column ) ) ; } else { $ data = [ ] ; $ data [ 'data' ] = $ column ; $ data [ 'title' ] = $ column ; $ collection -> push ( new Column ( $ data ) ) ; } } return $ collection ; }
Convert array to collection of Column class.

@param array $columns
@return Collection
Convert array to collection of Column class .