Support the ongoing development of Laravel.io →
Database Eloquent

Hy everyone, I have a small problem and if anyone here would know the answer to it i would very much appreciate it.

The problem: I have two models (Picture and Resource) that are linek over morph relation. I want to delete real picture and location of the picture is in resource table. When I delete/forceDelete entry from resource its all ok and the picture is unlinked (i put unlinking in forceDelete() method in Resource model) but when i delete resource over the picture model ( picture->resource->forceDelete()) the method is not triggered and the picture is not deleted. Does anyone know why the metod is not triggered and how or what to do to trigger it.

tnx

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

vilim67 vilim67 Joined 25 May 2014

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.

© 2025 Laravel.io - All rights reserved.