© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
danzzz

Display an image (ImageColumn) from local storage (not public accessible)

hey all. I store some images on the local disk which is not accessible by the webserver, its just a file storage. Is it possible to show the images with ImageColumn in a table? Should I make a custom column and use laravel intevention plugin?
Solution
I ended up with this solution:

Forms\Components\ViewField::make('image')
                    ->view('filament.tables.columns.custom-upload-preview'),
Forms\Components\ViewField::make('image')
                    ->view('filament.tables.columns.custom-upload-preview'),



@php

    use Intervention\Image\ImageManager;
    use Intervention\Image\Drivers\Gd\Driver;

    $manager = new ImageManager(new Driver());

    $image = $manager->read(storage_path('app/').$getRecord()->file_name); // app/uploads/some.png

    $image->scaleDown(200);

    $base64 = base64_encode($image->encode());

@endphp

<img class="rounded-xl" src="{{ 'data:image/jpeg;base64,' . $base64 }}" alt="{{ $getRecord()->title }}">
@php

    use Intervention\Image\ImageManager;
    use Intervention\Image\Drivers\Gd\Driver;

    $manager = new ImageManager(new Driver());

    $image = $manager->read(storage_path('app/').$getRecord()->file_name); // app/uploads/some.png

    $image->scaleDown(200);

    $base64 = base64_encode($image->encode());

@endphp

<img class="rounded-xl" src="{{ 'data:image/jpeg;base64,' . $base64 }}" alt="{{ $getRecord()->title }}">
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Delete avatar image file from local storage
FilamentFFilament / ❓┊help
3y ago
ImageColumn is not showing image
FilamentFFilament / ❓┊help
2y ago
ImageColumn image zoom
FilamentFFilament / ❓┊help
8mo ago
FileUpload load image from /storage/... instead of /public/...
FilamentFFilament / ❓┊help
2y ago