Du kan ombryde nullbare felter i IFNULL()-funktionen, noget som dette:
DB::raw('(IFNULL(sales.taxable,0)
+ IFNULL(sales.non_taxable,0)
+ IFNULL(category_sales.amount,0)
+ IFNULL(department_sales.amount,0)
) as total_sales'),
DB::raw('0.0825*(IFNULL(sales.taxable,0)
+ IFNULL(category_sales.amount,0)
+ IFNULL(department_sales.amount,0)) as total_tax'))