I am working with an e-commerce site in laravel. When a guest user adds product to carts I am storing the data in session but when he is a logged in user I am saving the cart data in database. While checkout the user must log in to the site. But after login the sessions cart value destroyed.
So after getting the user object while login and before destroying the previous session I want to save sessions cart data into database.
Please suggest me how to accomplish this task.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…