Model Callback beforeDelete

前端 未结 2 1684
慢半拍i
慢半拍i 2021-01-16 02:27

I\'m trying to delete images when deleting the container of those images with a cascading model::delete

The cascading works fine, but I can\'t get the model call bac

2条回答
  •  清歌不尽
    2021-01-16 02:59

    If the models are related with hasMany/hasOne, both RelatedImage::beforeDelete() and RelatedImage::afterDelete() should be called when they are removed. Try putting the delete logic there instead?

提交回复
热议问题