-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I'm having a problem retrieving the list of attachments from my richTextAttribute so I can delete them when the related model instance is deleted.
Here are the details:
I'm writing an app using Livewire and stancl/tenancy and have a model that has a richTextAttribute called $message.
I have followed your instructions for allowing file uploads into this attribute and that all seems to be working as expected.
The attachments render correctly when viewing the saved model instance:
When the user deletes a model instance, I need to ensure that files they uploaded into $message also get deleted on the filesystem.
Unfortunately, when I call $message->attachments() I get an empty collection.
I have also tried calling $message->attachments() in the actual delete() method when deleting a Result (rather than in the ResultObserver in case this was caused by the richTextAttribute having already been deleted by the time ResultObserver was running), but the output is the same.
Any suggestions?