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");


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.
Was this page helpful?