src/EloquentDataTable.php
public function addColumns(array $names, $order = false)
    {
        foreach ($names as $name => $attribute) {
            if (is_int($name)) {
                $name = $attribute;
            }

            $this->addColumn($name, function ($model) use ($attribute) {
                return $model->getAttribute($attribute);
            }, is_int($order) ? $order++ : $order);
        }

        return $this;
    }
public function addColumns(array $names, $order = false)
    {
        foreach ($names as $name => $attribute) {
            if (is_int($name)) {
                $name = $attribute;
            }

            $this->addColumn($name, function ($model) use ($attribute) {
                return $model->getAttribute($attribute);
            }, is_int($order) ? $order++ : $order);
        }

        return $this;
    }
public function addColumns ( array $ names , $ order = false ) { foreach ( $ names as $ name => $ attribute ) { if ( is_int ( $ name ) ) { $ name = $ attribute ; } $ this -> addColumn ( $ name , function ( $ model ) use ( $ attribute ) { return $ model -> getAttribute ( $ attribute ) ; } , is_int ( $ order ) ? $ order ++ : $ order ) ; } return $ this ; }
Add columns in collection.

@param  array  $names
@param  bool|int  $order
@return $this
Add columns in collection .