protected function storeCartData($isNewItem = false)
    {
        if ($this->id) {
            $this->cartDriver->updateCart($this->id, $this->data());

            if ($isNewItem) {
                $this->cartDriver->addCartItem($this->id, $this->items->last()->toArray());
            }

            return;
        }

        event(new CartCreated($this->toArray()));
        $this->cartDriver->storeNewCartData($this->toArray());
    }
protected function storeCartData($isNewItem = false)
    {
        if ($this->id) {
            $this->cartDriver->updateCart($this->id, $this->data());

            if ($isNewItem) {
                $this->cartDriver->addCartItem($this->id, $this->items->last()->toArray());
            }

            return;
        }

        event(new CartCreated($this->toArray()));
        $this->cartDriver->storeNewCartData($this->toArray());
    }
protected function storeCartData ( $ isNewItem = false ) { if ( $ this -> id ) { $ this -> cartDriver -> updateCart ( $ this -> id , $ this -> data ( ) ) ; if ( $ isNewItem ) { $ this -> cartDriver -> addCartItem ( $ this -> id , $ this -> items -> last ( ) -> toArray ( ) ) ; } return ; } event ( new CartCreated ( $ this -> toArray ( ) ) ) ; $ this -> cartDriver -> storeNewCartData ( $ this -> toArray ( ) ) ; }
Stores the cart data on the cart driver.

@param bool Weather its a new item or an existing one
@return void
Stores the cart data on the cart driver .