original_string: protected function compileAggregate(Builder $query, $aggregate)
      {
          $column = $this->columnize($aggregate['columns']);
  
          // If the query has a "distinct" constraint and we're not asking for all columns
          // we need to prepend "distinct" onto the column name so that the query takes
          // it into account when it performs the aggregating operations on the data.
          if ($query->distinct && $column !== '*') {
              $column = 'distinct '.$column;
          }
  
          return 'select '.$aggregate['function'].'('.$column.') as aggregate';
      }
code: protected function compileAggregate(Builder $query, $aggregate)
      {
          $column = $this->columnize($aggregate['columns']);
  
          // If the query has a "distinct" constraint and we're not asking for all columns
          // we need to prepend "distinct" onto the column name so that the query takes
          // it into account when it performs the aggregating operations on the data.
          if ($query->distinct && $column !== '*') {
              $column = 'distinct '.$column;
          }
  
          return 'select '.$aggregate['function'].'('.$column.') as aggregate';
      }
code_tokens: protected function compileAggregate ( Builder $ query , $ aggregate ) { $ column = $ this -> columnize ( $ aggregate [ 'columns' ] ) ; // If the query has a "distinct" constraint and we're not asking for all columns // we need to prepend "distinct" onto the column name so that the query takes // it into account when it performs the aggregating operations on the data. if ( $ query -> distinct && $ column !== '*' ) { $ column = 'distinct ' . $ column ; } return 'select ' . $ aggregate [ 'function' ] . '(' . $ column . ') as aggregate' ; }
docstring: Compile an aggregated select clause.
  
  @param  \Illuminate\Database\Query\Builder  $query
  @param  array  $aggregate
  @return string
docstring_tokens: Compile an aggregated select clause .