src/ParameterCounters/SimpleDistinctValue.php
public function count($name, $query, CountableFilterInterface $filter)
    {
        // if the columnname is not set, assume an id field based on a table name
        $columnName  = (empty($this->columnName))
                            ?   $name
                            :   $this->columnName;

        if ( ! $this->includeEmpty) {
            $query->whereNotNull($columnName);
        }

        return $query->select(
                        "{$columnName} AS {$this->columnAlias}",
                        DB::raw("{$this->countRaw} AS {$this->countAlias}")
                     )
                     ->groupBy($columnName)
                     ->pluck($this->countAlias, $this->columnAlias);
    }
public function count($name, $query, CountableFilterInterface $filter)
    {
        // if the columnname is not set, assume an id field based on a table name
        $columnName  = (empty($this->columnName))
                            ?   $name
                            :   $this->columnName;

        if ( ! $this->includeEmpty) {
            $query->whereNotNull($columnName);
        }

        return $query->select(
                        "{$columnName} AS {$this->columnAlias}",
                        DB::raw("{$this->countRaw} AS {$this->countAlias}")
                     )
                     ->groupBy($columnName)
                     ->pluck($this->countAlias, $this->columnAlias);
    }
public function count ( $ name , $ query , CountableFilterInterface $ filter ) { // if the columnname is not set, assume an id field based on a table name $ columnName = ( empty ( $ this -> columnName ) ) ? $ name : $ this -> columnName ; if ( ! $ this -> includeEmpty ) { $ query -> whereNotNull ( $ columnName ) ; } return $ query -> select ( "{$columnName} AS {$this->columnAlias}" , DB :: raw ( "{$this->countRaw} AS {$this->countAlias}" ) ) -> groupBy ( $ columnName ) -> pluck ( $ this -> countAlias , $ this -> columnAlias ) ; }
Returns the count for a countable parameter, given the query provided

@param string                   $name
@param EloquentBuilder          $query
@param CountableFilterInterface $filter
@return array
Returns the count for a countable parameter given the query provided