public function addCoupon(CouponContract $coupon) { if (!$this->cart->multipleCoupons) { $this->cart->coupons = []; } $this->cart->coupons[$coupon->code] = $coupon; $this->update(); }