Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy cart #659

Open
maxim8181 opened this issue Jul 9, 2021 · 3 comments
Open

Destroy cart #659

maxim8181 opened this issue Jul 9, 2021 · 3 comments

Comments

@maxim8181
Copy link

Hello
Is there a way to destroy all carts of we do not know their name?

Thanks

@bumbummen99
Copy link

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.

@maxim8181
Copy link
Author

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

@bumbummen99
Copy link

bumbummen99 commented Jul 9, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants