public function decrementQuantityAt($cartItemIndex, $quantity = 1)
    {
        $this->existenceCheckFor($cartItemIndex);

        if ($this->items[$cartItemIndex]->quantity <= $quantity) {
            return $this->removeAt($cartItemIndex);
        }

        $this->items[$cartItemIndex]->quantity -= $quantity;

        $this->cartDriver->setCartItemQuantity(
            $this->items[$cartItemIndex]->id,
            $this->items[$cartItemIndex]->quantity
        );

        return $this->cartUpdates();
    }
public function decrementQuantityAt($cartItemIndex, $quantity = 1)
    {
        $this->existenceCheckFor($cartItemIndex);

        if ($this->items[$cartItemIndex]->quantity <= $quantity) {
            return $this->removeAt($cartItemIndex);
        }

        $this->items[$cartItemIndex]->quantity -= $quantity;

        $this->cartDriver->setCartItemQuantity(
            $this->items[$cartItemIndex]->id,
            $this->items[$cartItemIndex]->quantity
        );

        return $this->cartUpdates();
    }
public function decrementQuantityAt ( $ cartItemIndex , $ quantity = 1 ) { $ this -> existenceCheckFor ( $ cartItemIndex ) ; if ( $ this -> items [ $ cartItemIndex ] -> quantity <= $ quantity ) { return $ this -> removeAt ( $ cartItemIndex ) ; } $ this -> items [ $ cartItemIndex ] -> quantity -= $ quantity ; $ this -> cartDriver -> setCartItemQuantity ( $ this -> items [ $ cartItemIndex ] -> id , $ this -> items [ $ cartItemIndex ] -> quantity ) ; return $ this -> cartUpdates ( ) ; }
Decrements the quantity of a cart item.

@param int Index of the cart item
@param int quantity to be decreased
@return array
Decrements the quantity of a cart item .