© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
bernhard

How to use SpatieMediaLibraryFileUpload outside of a resource (custom form)?

What exactly do I have to do, to get the SpatieMedia Field working on a custom form (outside of a resource)?

I am building a custom form (inside a panel), which isn't a resource. The following code just works on the same model and the same field;

SpatieMediaLibraryFileUpload::make("top_logo")
            ->disk("media")
            ->image()
            ->collection("top_logo");
SpatieMediaLibraryFileUpload::make("top_logo")
            ->disk("media")
            ->image()
            ->collection("top_logo");


On a custom form, I see the field, I can upload something but after reload it is empty again. If I manually fill the relationship, the field is still empty.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Use inputs outside a form
FilamentFFilament / ❓┊help
8mo ago
How to use SpatieMediaLibraryFileUpload in hintAction?
FilamentFFilament / ❓┊help
3y ago
How to use a script in a custom Form FIeld ?
FilamentFFilament / ❓┊help
3y ago
How to use SpatieMediaLibraryFileUpload in the Builder
FilamentFFilament / ❓┊help
6mo ago