original_string: protected function compileUnionAggregate(Builder $query)
      {
          $sql = $this->compileAggregate($query, $query->aggregate);
  
          $query->aggregate = null;
  
          return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table');
      }
code: protected function compileUnionAggregate(Builder $query)
      {
          $sql = $this->compileAggregate($query, $query->aggregate);
  
          $query->aggregate = null;
  
          return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table');
      }
code_tokens: protected function compileUnionAggregate ( Builder $ query ) { $ sql = $ this -> compileAggregate ( $ query , $ query -> aggregate ) ; $ query -> aggregate = null ; return $ sql . ' from (' . $ this -> compileSelect ( $ query ) . ') as ' . $ this -> wrapTable ( 'temp_table' ) ; }
docstring: Compile a union aggregate query into SQL.
  
  @param  \Illuminate\Database\Query\Builder  $query
  @return string
docstring_tokens: Compile a union aggregate query into SQL .