How to display images in edit section of the row?

I have a path of the photos (which are on the AWS) in my database and i wanted to do something like this to display photos in form builder
Forms\Components\FileUpload::make('photo_path')
->multiple()
->columnSpan('full')
->url('photo_path'),
Forms\Components\FileUpload::make('photo_path')
->multiple()
->columnSpan('full')
->url('photo_path'),
11 Replies
Firebird
Firebird8mo ago
Bump
Dennis Koch
Dennis Koch8mo ago
If they are on AWS (S3?) that’s probably not the default disk and you have to specify a disk? If you just want to show them without editing I’d probably go for a View Field
Firebird
Firebird8mo ago
i specified the disk but still no results
FileUpload::make('photo_path')
->disk('s3')
->directory('images')
->multiple(),
FileUpload::make('photo_path')
->disk('s3')
->directory('images')
->multiple(),
Dennis Koch
Dennis Koch8mo ago
Any console errors? Did you setup CORS? Is the path correct?
Firebird
Firebird8mo ago
no console errors, also the image is public, anyone can access it as long as they have the link, path is correct bcs i display the image in table builder
Dennis Koch
Dennis Koch8mo ago
So it's a full url instead of a path?
Firebird
Firebird8mo ago
like that
ImageColumn::make('photo_path')
->label('Image')
->url('photo_path'),
ImageColumn::make('photo_path')
->label('Image')
->url('photo_path'),
yes
Dennis Koch
Dennis Koch8mo ago
That's not how it works. You can't pass a full url it needs to be the path. I still recommend using a View Field instead if you don't have to upload new files
Firebird
Firebird8mo ago
i even tried to instead of giving it full url, just to give the photo name
Dennis Koch
Dennis Koch8mo ago
Full path + the correct disk should be the way. And CORS need to be configured right on S3
Firebird
Firebird8mo ago
you are correct, i just inserted just path of the photo like that images/teste-image.jpg and it reacted to it, now it gives a console errors and yes you are right, it is CORS error and now i guess thats on me thank you ❤️