Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

earmsby's avatar

Image column

I'm trying to display a thumbnail of an image uploaded to a Filament app.

The form field for the image upload is:

FileUpload::make('file_path')
                    ->disk('public')
                    ->directory('uploads')
                    ->visibility('public')

I can see that the image is in the directory: storage\public\uploads

Then, my table column is:

ImageColumn::make('file_path')
                    ->label('Preview')
                    ->disk('public')
                    ->visibility('public'),

When I view the table, the image is not found and I can see in dev tools it's showing as:

src="http://localhost:8000/storage/uploads/01K88KDG3E5NVZ0V10B5BTAWCT.jpg"

I'm new to working with file uploads in Laravel and Filament, so I'm guessing I'm missing something. How do I tell the column to get the image from the storage/public/uploads directory, not storage/uploads?

1 like
8 replies
LaryAI's avatar
Level 58

You're very close! The issue is likely due to Laravel's file serving setup. When you store files in storage/app/public, you need to make those files accessible from the public web directory. This is accomplished with Laravel's storage symlink. Here’s how to fix your problem:

1. Ensure the Symlink Exists

Run the following Artisan command to create a symbolic link from public/storage to storage/app/public:

php artisan storage:link

This makes files in storage/app/public/uploads accessible in the browser at /storage/uploads.

2. Correct FileUpload and ImageColumn Fields

Your configurations for FileUpload and ImageColumn are correct. disk('public') works with the storage/app/public directory.

FileUpload::make('file_path')
    ->disk('public')
    ->directory('uploads')
    ->visibility('public'),
ImageColumn::make('file_path')
    ->label('Preview')
    ->disk('public')
    ->visibility('public'),

3. Check filesystems.php Configuration

Make sure your config/filesystems.php has a public disk set up like this:

'disks' => [
    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL') . '/storage',
        'visibility' => 'public',
    ],
    // ...
],

4. Confirm The File Exists

Double-check that the file physically exists at storage/app/public/uploads/01K88KDG3E5NVZ0V10B5BTAWCT.jpg.

5. Media Is Publicly Accessible

After creating the symlink (php artisan storage:link), your images will be accessible at:

http://localhost:8000/storage/uploads/01K88KDG3E5NVZ0V10B5BTAWCT.jpg

If you had not run storage:link, this path would not work.


Summary

The key step is to run:

php artisan storage:link

Now, your Filament table will display image thumbnails as expected. If you still don't see the images, clear your browser cache or manually check that the image is accessible at the above URL.

earmsby's avatar

Didn't work. When I try to access the image directly, I get a "localhost refused to connect." message.

earmsby's avatar

There must be some other step somewhere. I followed all of the above, including the symlink. But I still am not able to view the image either in the table or manually in a separate tab. Is there some permissions thing I need to do? FWIW, I am using Herd on my local machine.

Glukinho's avatar

What do you have in filesystems.php in disks.public?

Mine is:

'public' => [
	'driver'     => 'local',
	'root'       => storage_path('app/public'),
	'url'        => env('APP_URL') . '/storage',
	'visibility' => 'public',
	'throw'      => false,
	'report'     => false,
],

In my filament table:

ImageColumn::make('logo_path')
	->label('')
	->checkFileExistence(false)
	->disk('public'),

Model's logo_path is images/company-logos/logo.png

I have a symlink C:\project\public -> C:\project\storage\app\public (not sure if it's important or not).

In .env:

APP_URL=http://localhost:8000

In the table I see an image with src="http://localhost:8000/storage/images/company-logos/logo.png"

I use simple php artisan serve for serving app locally, on Windows.

Maybe it helps you.

earmsby's avatar

Yes, I have everything exactly the same as you (except the fieldname and the specific file name). The only difference is that I am using Herd instead of artisan serve. I wonder if it could be an issue with Herd.

Glukinho's avatar

Try simple php artisan serve. If it works, something's wrong with Herd. Otherwise, the problem is with your configuration or paths.

earmsby's avatar

Thanks for the suggestion. Unfortunately, it looks like you can't use php artisan serve if you're also using Herd due to port conflicts.

I'll try to double check both the config and the paths. It's gotta be something with those.

Glukinho's avatar

There must be a way to turn off Herd's nginx server for the moment of testing with php artisan serve.

Or just specify other port:

php artisan serve --port=8001

And test your app with URL http://localhost:8001

Please or to participate in this conversation.