public function storeNewCartData($cartData)
    {
        // Set id of the item to be used for updates later
        foreach ($cartData['items'] as $key => $item) {
            $cartData['items'][$key]['id'] = $key + 1;
        }

        // We use static number 1 as the cart id
        session([
            $this->sessionKey => array_merge($cartData, ['id' => 1]),
        ]);
    }
public function storeNewCartData($cartData)
    {
        // Set id of the item to be used for updates later
        foreach ($cartData['items'] as $key => $item) {
            $cartData['items'][$key]['id'] = $key + 1;
        }

        // We use static number 1 as the cart id
        session([
            $this->sessionKey => array_merge($cartData, ['id' => 1]),
        ]);
    }
public function storeNewCartData ( $ cartData ) { // Set id of the item to be used for updates later foreach ( $ cartData [ 'items' ] as $ key => $ item ) { $ cartData [ 'items' ] [ $ key ] [ 'id' ] = $ key + 1 ; } // We use static number 1 as the cart id session ( [ $ this -> sessionKey => array_merge ( $ cartData , [ 'id' => 1 ] ) , ] ) ; }
Stores the cart and cart items data.

@param array Cart data (including items)
@return void
Stores the cart and cart items data .