src/Cart.php
public function toArray()
    {
        return [
            'id' => $this->id,
            'items' => array_map(function (CartItem $item) {
                return $item->toArray();
            }, $this->items),
        ];
    }
public function toArray()
    {
        return [
            'id' => $this->id,
            'items' => array_map(function (CartItem $item) {
                return $item->toArray();
            }, $this->items),
        ];
    }
public function toArray ( ) { return [ 'id' => $ this -> id , 'items' => array_map ( function ( CartItem $ item ) { return $ item -> toArray ( ) ; } , $ this -> items ) , ] ; }
Export the cart as an array.

@return array
Export the cart as an array .