src/Base/Statements.php
public function sum(string $column = null): int
    {
        if (!is_null($column)) {
            return $this->column($column)->sum();
        }

        return array_sum($this->toArray());
    }
public function sum(string $column = null): int
    {
        if (!is_null($column)) {
            return $this->column($column)->sum();
        }

        return array_sum($this->toArray());
    }
public function sum ( string $ column = null ) : int { if ( ! is_null ( $ column ) ) { return $ this -> column ( $ column ) -> sum ( ) ; } return array_sum ( $ this -> toArray ( ) ) ; }
Calculates the sum of values in the collection.

@param string $column The column.

@return int The collection sum.
Calculates the sum of values in the collection .