LaravelShoppingcart
LaravelShoppingcart copied to clipboard
Destroy cart
Hello Is there a way to destroy all carts of we do not know their name?
Thanks
You could delete all Carts from the cart table whereNotIn
your known names but keep in mind thst carts could still be saved in sessions.
Thanks for answer but i do not understand, i would like destroy if Is possible all carts not just the instanced one even if i do not know the name of the carts
Thanks for answer but i do not understand, i would like destroy if Is possible all carts not just the instanced one even if i do not know the name of the carts
As i said, check whereNotIn()
https://laravel.com/docs/8.x/queries#additional-where-clauses
Also, afaik the instanced cart is not saved in DB, maybe you can just truncate the whole table without a where at all.