/** * Get the total purchases * */ public function purchases() { return Stock::dateRange($this->from, $this->to)->sum('cost'); }