Transform columns
@param $columns
@return array
353432
private function transformColumns($columns)
    {
        return array_map(function ($column) {
            return [
                'Field' => $column->COLUMN_NAME,
                'Type' => $column->DATA_TYPE,
                'Null' => $column->IS_NULLABLE,
                'Key' => $column->ORDINAL_POSITION,
                'Default' => $column->COLUMN_DEFAULT,
                'Char max len' => $column->CHARACTER_MAXIMUM_LENGTH
            ];
        }, $columns);
    }
68741
private function processColumns(array $columns): array
    {
        $results = [];

        foreach ($columns as $column) {
            $types = [$column->phpType()];

            if ($column->isNullable()) {
                $types[] = 'null';
            }

            $results[$column->getName()] = $types;
        }

        return $results;
    }
1189527
public function columns(array $columns)
    {
        $this->getColumns()->setColumns($columns);

        $this->manager->columns();

        return $this;
    }
162649
protected function handleSetColumns(array $columns)
    {
        if (empty($columns)) {
            return '';
        }

        $sql = [];

        foreach ($columns as $column) {
            $sql[] = $this->wrap($column['column']) . ' = ' . $this->param($column['value']);
        }

        return ' SET ' . implode(', ', $sql);
    }
900167
public function columns_sortable( $columns ) {
		foreach ( $this->columns as $slug => $column ) {
			// Remove column when it’s not sortable.
			if ( ! $column['sortable'] ) {
				unset( $columns[ $slug ] );
				continue;
			}
		}

		return $columns;
	}
781137
public function setColumns(array $columns)
    {
        foreach ($columns as $column) {
            $this->columns->push($column);
        }

        return $this;
    }
1083100
public function makeAdminColumnsSortable($columns)
    {
        $admin_columns = $this->getAdminColumns();
        if (!Arr::iterable($admin_columns)) {
            return $columns;
        }

        foreach ($admin_columns as $k) {
            $columns[$k] = $k;
        }
        return $columns;
    }
1302294
public function columns($columns) {
        if (is_array($columns)) {
            $this->sql .= '(`' . implode('`, `', $columns) . '`) ';
        } else if (is_string($columns)) {
            $this->sql .= "($columns) ";
        }
        return $this;
    }
705695
public function columns(array $columns): self
    {
        foreach ($columns as $name => $alias) {
            if (!is_string($name)) {
                $this->column($alias, null);
                continue;
            }
            if (is_string($alias)) {
                $this->column($name, $alias);
            } else {
                $this->column($alias, $name);
            }
        }
        return $this;
    }
1128377
protected function getColumnEnumeration( $columns ){
		$list	= array();
		foreach( $columns as $column )
			$list[]	= $column == '*' ? $column : '`'.$column.'`';
		return implode( ', ', $list );
	}
450413
protected function getDefaultColumnWidths(array $columns)
    {
        $widths = $this->arrayOfStrLens(array_keys($columns));

        return array_combine(array_keys($columns), $widths);
    }
1005923
public function getModels($columns = ['*'])
    {
        return $this->model->hydrate(
            $this->query->get($columns)->all(),
            $this->model->getConnectionName()
        )->all();
    }
232668
protected function _normalizeTableColumns($columns)
    {
        $_defaults = [
            'get' => false,
            'before' => '',
            'after' => '',
        ];
        $result = [];

        foreach ($columns as $name => $options) {
            if (is_array($options)) {
                $_defaults['get'] = $name;
                $result[$name] = array_merge($_defaults, $options);
            } else {
                $_defaults['get'] = $options;
                $result[$options] = $_defaults;
            }
        }
        return $result;
    }
133400
protected function handleColumns(array $columns)
    {
        if (empty($columns)) {
            return '*';
        }

        $sql = [];

        foreach ($columns as $column) {
            if ($column['alias'] !== null) {
                $sql[] = $this->wrap($column['name']) . ' AS ' . $this->wrap($column['alias']);
            } else {
                $sql[] = $this->wrap($column['name']);
            }
        }
        return implode(', ', $sql);
    }
978377
public function populateColumns($columns = [])
	{
		$_columns = [];
		foreach ($columns as $key => $value)
		{
			if (is_string($value))
			{
				$value_log = explode(':', $value);
				$_columns[$key] = ['attribute' => $value_log[0]];

				if (isset($value_log[1]) && $value_log[1] !== null) {
					$_columns[$key]['format'] = $value_log[1];
				}

				if (isset($value_log[2]) && $value_log[2] !== null) {
					$_columns[$key]['header'] = $value_log[2];
				}
			} elseif (is_array($value)) {
				if (!isset($value['attribute']) && !isset($value['value'])) {
					throw new \InvalidArgumentException('Attribute or Value must be defined.');
				}
				$_columns[$key] = $value;
			}
		}

		return $_columns;
	}
1126451
protected function getColumnHeaders($columns)
    {
        $headers = [];

        foreach ($columns as $column => $label) {
            $headers[] = Lang::get($label);
        }

        return $headers;
    }
14854
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;
    }