If you are persisting it in the database also, why not just pass it down to the page (with Inertia::render()) ? If you need to get it in the cart you can easily grab it with usePage()
Inside the Cart component (or any component really)
const {cart} = usePage().props
If the cart is on every single page in the app, you can even share it with all components by using https://inertiajs.com/shared-data