Preload/Persist Spatie Media Library Field
Hi all,
A client of us reported a "bug" in our system. They can create products in the CMS and upload images to this product. We use the excellent Filament Spatie Media Library plugin for this. They have the possibility to save a draft of a new product so they can finalize it later when all the product details are known.
What we do when they save the draft, is create a Draft model (id (int 11), model (var 255), data (json)) with all the currently known details such as title, description etc. We do this using the Filament\Forms\Get $get method. So $get('title'), $get('description'), we put those values in an array and json_encode this.
The "bug" we're experiencing right now is that when they have uploaded some images, these are serialized (livewire-file:G1tFQf7LWMashwWzEhTtu1BvuRX4ag-metadGVzdGJlZWxkLmpwZWc=-.jpg) and saved. We serialize them using:
After fetching the draft again, we unserialize the images, so that they are transformed to a Livewire\Features\SupportFileUploads\TemporaryUploadedFile (See screenshot). This looks all good, but my upload fields stay empty. Does someone here know how to solve this?
0 Replies