File Upload
I'm trying to configure file upload to work with imagekit
I Created a new Adapter for FileSystem that uses ImageKit behind the scene
At First I tried to use the default settings
But the problem is the image is stuck in /livewire-tmp and it doesn't move it to the narrators folder
Then I tried this :
But the problem is I cannot move the file from /livewire-tmp to my folder and I ran Storage::fileExists and it seems file doesn't exists even If I use $file->exists() it returns false
But I can see the fine exists in image kit
I don't know how to fix this I would appreciate it if anyone could help
11 Replies
if you can get it working with Livewires upload system then it will work with filament
but i cant really help you as its really a Livewire question tbh
i dont think its gonna be easy
Do you have any alternatives that we can use / a work around / package ?
I'd use S3
Thanks you for the recommendation
It seems the team found a way to upload it like a charm
Right now the file get uploaded successfuly and we can show the image on the table but how can we show it in the FileUpload ? Is there a method that gets an url and shows the previous uploaded image preivew ?
it should do that automatically for you
if you fill the form with the image path
whatever gets returned from the form should be filled into it again
We have a model called Images that is morph
Right now i'm confused which method to call ?
is it loadStateFromRelationships() ?
uhhh potentially
loadStateFromRelationshipsUsing() maybe
The thing is the main backend is js but because laravel has a rich community especially filament
We appreciate the work you guys put on filament I don't think there's an admin panel that comes near filament it terms of customization even admin js
That's why we have a images model that looks like this
id
imagable_type
Imgable_id
provider_id
url
width
height
and users model looks like this
id
image_id ( points to images )
etc ...
The main question is how to show the image.url in file upload ?
Thank you for your support
how are you saving the images
ok so you basically need the opposite in the loadStateFromRelationshipsUsing()
you call
$component->state()
with the path of the stored file
the path should be relative to the disk of this upload