I tried with google and StackOverflow but there is nothing useful.
Does anyone know how to extend Query Builder? For example, I want to write my own count() method from Query Builder...
/**
* Retrieve the "count" result of the query.
*
* @param string $columns
* @return int
*/
public function count($columns = '*')
{
if (! is_array($columns)) {
$columns = [$columns];
}
return (int) $this->aggregate(__FUNCTION__, $columns);
}