Unique identifier for file upload (Spatie Media Library)? 🤷♂
Hello!
Quick context: First time poster here. I'm pretty new to Filament. I'm loving it so far. So much more capable (and fun to work with) than Nova! I'm more of a front-end designer so I always like con start with that because I sometimes miss things obvious to traditional devs
That said here is my current issue:
Gits:
https://gist.github.com/nathangross/fcd60c84a7b312b4b746f2fca8c01c0a
To build out custom pages, I'm using the Builder with a bunch of different blocks. One block (called ChapterBlock) I've got a bunch of fields (title, text, etc) including an image field. I'm using Spatie Media Library (package and filament plugin). It's working great so far, until I try to use it within this ChapterBlocks—specifically multiple instances on a single page.
I upload a unique image on each ChapterBlock but upon save, only to have 1 image uploaded to the media library and each chapter block shows the same image.
My question is, how do I set a sort of unique id for each instance of my block so I can ensure each block can have an image? Or is there a better way to handle this?
(Notice I'm trying to create a unique ID but that's not working)
Thanks in advance!
0 Replies