Support the ongoing development of Laravel.io →
Requests Eloquent Queues
Last updated 4 months 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!

LaraJobs

Your banner here too?

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.