F
Filament12mo ago
danzzz

FileUpload And Morph

I have an UploadResource which stores Uploads and some other data. In the Model it I have a method "uploadable" and I use "MorphTo". In my User Model I have "MorphMany" uploads. This works fine with a RelationManger. But now I want to use it also for other Resources which also should have Uploads but dont want to use RelationManger, just an FileUploadField. Any ideas?
3 Replies
wdog
wdog11mo ago
find any solution? I have the same problem
Patrick
Patrick11mo ago
FileUpload::make('uploads')
->relationship('uploads', 'file_column_in_upload_model')
FileUpload::make('uploads')
->relationship('uploads', 'file_column_in_upload_model')
does this not work? @wdog
wdog
wdog11mo ago
relationship does not exists on FileUpload I'm using a morph Image class changed to default behaviour.... I cannot figure how work with morph and uploadFile 😦
Want results from more Discord servers?
Add your server