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

kpiechowski25's avatar

Filament FileUpload Component Not Loading Private Files on Edit

Hi everyone, I'm working on a Laravel project using Filament v3, and I'm facing an issue with the FileUpload component when dealing with private files.

I need to store private user files (like images and documents) using the FileUpload component, and I'm storing them in storage/app/private. This works fine for uploading and displaying files on other parts of the application for example in Infolist - automatically generates temporary URLs for private files.

When editing a resource that has existing files uploaded through the FileUpload component, the existing files don’t load in the form, so it looks as if there are no files uploaded. As a result, if I submit the form without re-uploading, the field in the database is overridden with an empty value.

FileUpload::make('attachments')
    ->hint('some hint')
    ->label('some label')
    ->multiple()
    ->visibility('private')
    ->directory('user-attachments')
    ->disk('local')
    ->maxSize(10240)
    ->maxFiles(5);
'local' => [
            'driver' => 'local',
            'root' => storage_path('app/private'),
            'serve' => true,
            'throw' => false,
        ],

I should mention that i store it in json column with array cast in model.

0 likes
1 reply
saspegas's avatar

Since it is on local disk, it is not accessible from outside. I didn't see the file url change method of the FileUpload component, so I added action as a quick solution.

->hintAction(
    Action::make('download_invoice')
        ->label('Faturayı İndir')
        ->action(fn ($state) => Storage::download(collect($state)->first()))
    )

This code adds a link that says "Faturayı İndir" in the upper right corner of the file upload component. If clicked, it downloads the file.

Please or to participate in this conversation.