F
Filament16mo ago
hhnk

How to add properties to a file?

Is it possible to add a custom property to a file using the FileUpload component with Filepond? Something like storing the uploader's ID or a description field.
5 Replies
awcodes
awcodes16mo ago
Great avatar by the way. Lol. What have you tried? You can’t attach meta directly to a FileUpload but you could use additional fields to accomplish this. Or you could use something like https://filamentphp.com/plugins/ralphjsmit-media-library-manager. https://filamentphp.com/plugins/filament-spatie-media-library or https://filamentphp.com/plugins/awcodes-curator
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
Filament
Curator by Adam Weston - Filament
A media manager / picker plugin for Filament Panels.
hhnk
hhnkOP16mo ago
Thanks lol! Great suggestions but these seem like overkill as I'd just like to have a couple JSON columns to store extra data like a user id and description
awcodes
awcodes16mo ago
Fair enough. It can be done but you’ll have to do it yourself as it’s not built in to the FileUpload field.
hhnk
hhnkOP16mo ago
Tempted to just to do it in livewire 🤣 would be cool to have custom properties for files out of the box. Thanks for the prompt replies 👍🏻
awcodes
awcodes16mo ago
Good luck. I think you could do it with standard form fields, but whatever you need.
Want results from more Discord servers?
Add your server