Spatie Media File Upload Issue
Hello, Does anyone know how to "insert" image into form. I have this action witch is getting view from Livewire component. And livewire component itself has forms which contain Spatie Media Library. Now the issue is i cannot get that fileupload to attach and preview image.. Any solution?
4 Replies
What is the context? Is it durning create or after create?
You should just be able to pass record to the form and then the make() would just work for the product image.
Passing record to the the media field seems off to me.
After create, it is in table Action within infolist(), that infolist takes Livewire component which is providing SpatieMediaFileUpload
I’d recommend going through these docs a step at a time. And also look at the code for EditRecord to see how it’s being done there. https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-form