Support the ongoing development of →
Last updated 2 years ago.

You have company_id, address_id and number. Just delete the record manually from the pivot (not with detach). You don't have to use eloquent for everything, and in this case it would be probably cause more code then query builder.


I was already thinking about it, but I thought I was missing just some detach information to work, but I have not yet found a solution on the internet. The best should be to not even use the detach.

It will be the first time I will use Query Builder in Laravel. I thought about creating a Model CompanyAddress and remove with delete ().


Maybe there is an elegant solution with eloquent, you can try this...

Last updated 5 years ago.

Thank you, it worked the way you wanted it.


Sign in to participate in this thread!


Your banner here too?


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.

© 2024 - All rights reserved.