Support the ongoing development of Laravel.io →
Requests Eloquent Queues
Last updated 2 years ago.
0
Solution

you're saying that a product has many comments which means you have a foreign key constraint. unless you have cascade delete in your database, you have to delete the comments record first, then delete the product record.

i found this post but it's for laravel 4. not sure it will work in 5.3. http://stackoverflow.com/a/23626070

otherwise, delete the comment records first, then you can delete the product records

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.