FileUpload component doesn't show uploaded image

Hi all! I've mostly been lurking here, but I've come across a problem with the FileUpload component I can't figure out. When I select an image with it, it uploads perfectly and places it in the correct folder, but when viewing the resource, it's stuck on loading the image (see screenshot). In the network inspector of my browser, I can see it retrieves the image successfully, but it's stuck on "waiting for size". What am I doing wrong here? I created an additional driver for storing the image uploads, which is set via ENV-variables. The picture shows up correctly in the ImageColumn of the table builder. ImageResource.php form()
Forms\Components\FileUpload::make('src')
->label(__('fields.images.src'))
->helperText(__('fields.images.src.helper'))
->required()
->disk('media')
->maxSize(env('DRIVER_MEDIA_MAX_UPLOAD_BYTES'))
->image(),
Forms\Components\FileUpload::make('src')
->label(__('fields.images.src'))
->helperText(__('fields.images.src.helper'))
->required()
->disk('media')
->maxSize(env('DRIVER_MEDIA_MAX_UPLOAD_BYTES'))
->image(),
config/filesystems.php
'media' => [
'driver' => 'local',
'root' => env('DRIVER_MEDIA_PATH'),
'url' => env('DRIVER_MEDIA_URL'),
'visibility' => 'public',
'throw' => false,
],
'media' => [
'driver' => 'local',
'root' => env('DRIVER_MEDIA_PATH'),
'url' => env('DRIVER_MEDIA_URL'),
'visibility' => 'public',
'throw' => false,
],
ImageResource.php table()
Tables\Columns\ImageColumn::make('src')
->label(__('fields.images.src'))
->disk('media')
->height(75),
Tables\Columns\ImageColumn::make('src')
->label(__('fields.images.src'))
->disk('media')
->height(75),
2 Replies
LeandroFerreira
php artisan storage:link ? APP_URL (.env)?
phochs
phochsOP3y ago
I hadn't heard of that command yet, thanks for the tip! Turns out I'm an idiot, and I had http and https mixed up in the ENV variables. So that ended up being a quick fix. Thanks again for your reply!

Did you find this page helpful?