F
Filament7mo ago
Wally

Attachments concept tips

Hello everyone, this is my first post so sorry if I make some mistakes. I've some entities that have attachments and others that may have other ones . My consideration (also doubt) is: is it better considering a db table where all the attachments converge therefore thinking a FileUpload component that manage morphTo relations, or manage each attachment as a field of that specific model?
2 Replies
Tieme
Tieme7mo ago
Depends on more than that. i have a applications where 2 models have a total of 3 images per record. I defined the imaged in that model. Als other applications where almost all models / records can have attachments. There i have a morph to.
Wally
WallyOP7mo ago
Many thanks for your opinion. So you suggest me to make a custom component for managing the fileupload with relationship? Since that normal behaviour of FileUpload does not allow it, isn't? My models / records could have many attachments (files).
Want results from more Discord servers?
Add your server