How to use SpatieMediaLibraryFileUpload in the Builder
What I am trying to do
Using the builder my client can add blocks like "Banner/TextImage/AboutUs and so on.
For the images i want to use SpatieMediaLibrary (for the responsive images option).
The problem
When i add 1 banner, upload an image this works (the media uploads and binds to the model Page). When i add a second banner these images are both bound to the model page (changing 1 image, changes both images).
I want them to be unique to their own block in the builder (json).
What i did
In the documentation of the spatie plugin from filament: https://filamentphp.com/plugins/filament-spatie-media-library#filtering-media-2
I've got the following working
Giving the image a custom property adds
Now i am stuck how to continue or is there a better/smarter solution?
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
2 Replies
Creating a uuid and putting that in the "block" of the builder makes it possible to retrieve the image based on that uuid. But there must be a cleaner way/solution?
no one? or did i ask my question wrong?
You can't use this simple way. You need to make custom solutio like this
https://www.answeroverflow.com/m/1158821463168659496
How to use Spatie Media Library in a json repeater field. - Filament
I have a requirement, where I need to use Spatie Media file upload and store the model_id in json column.
Here is the required structure:
Here is what i am trying, It can read files fr...