public function add($columns, $label = null)
    {

        if (!is_array($columns)) {
            $columns = [$columns => $label];
        }

        foreach ($columns as $column => $label) {
            if (is_null($label)) {
                $label = str_replace(['_', '-'], ' ', ucfirst($column));
            }

            $this->add[$column] = $label;
        }

        return $this;
    }
public function add($columns, $label = null)
    {

        if (!is_array($columns)) {
            $columns = [$columns => $label];
        }

        foreach ($columns as $column => $label) {
            if (is_null($label)) {
                $label = str_replace(['_', '-'], ' ', ucfirst($column));
            }

            $this->add[$column] = $label;
        }

        return $this;
    }
public function add ( $ columns , $ label = null ) { if ( ! is_array ( $ columns ) ) { $ columns = [ $ columns => $ label ] ; } foreach ( $ columns as $ column => $ label ) { if ( is_null ( $ label ) ) { $ label = str_replace ( [ '_' , '-' ] , ' ' , ucfirst ( $ column ) ) ; } $ this -> add [ $ column ] = $ label ; } return $ this ; }
Add a new column
@param string  $column   the slug of the column
@param string  $label    the label for the column
Add a new column