Saving shopping cart in laravel database

0

good day community.

I am developing a shopping cart system with laravel and the following library: https://github.com/Crinsane/LaravelShoppingcart

but I have a problem or rather a doubt, when I want to finalize the purchase.

The store method asks me for an identifier "$ identifier" which I do not know where to get it from.

according to the documentation this "$ identifier" would be the username or the id,

Cart::store('username');

but if I use one of the 2 and the same user returns to make a purchase there is an error that there is already a record with that identifier.

I await your answers.

    
asked by hurt05 14.11.2017 в 16:40
source

1 answer

0

In the same library it says: To save you need to call store($identifier) where identifier is a random key, it can be the user or user id

Cart::store('username');

// To store a cart instance named 'wishlist'
Cart::instance('wishlist')->store('username');
    
answered by 15.11.2017 в 02:50