I wound personally create a cart table with expiration date and device/user identification.
So it expires automatically after some time, and the user can see the cart on all of its devices, and unauthorized can see it on the device.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Awesome People
I'm working on a e-commerce project, i'm building the api in Laravel for Mobile Apps and for the web app, i'm using vue-cli for web app
since the api is stateless which uses passport to authenticate user, i couldn't figure out the best way to create the cart functionality with the session and all
1 -> should i create a cart table in database and CRUD the cart details from front end Vue app and the mobile app
2 -> is there a way to create stateless shopping cart
i'm desperate to know how to do it
thank you
Well then, I would store it in the cookies.
Let's say you start shopping
Hope it helps.
Please or to participate in this conversation.