filament icon indicating copy to clipboard operation
filament copied to clipboard

Private Images from table and forms not generating temp url

Open arxjei opened this issue 8 months ago • 1 comments

Package

filament/filament

Package Version

v3.2

Laravel Version

v11.31

Livewire Version

v3.5

PHP Version

PHP 8.2.13

Problem description

There’s something wrong with the private image. It can't render in the table or the form. I already ran optimize:clear and also tried composer dumpautoload. I also gave full permissions to the storage folder. I checked the database, and it saved the URL path of the file correctly, but the file itself doesn't appear in the target path. Since it didn’t show up in the private/local directory, I manually placed the file there and renamed it according to the database entry, but it’s still the same - no image appears in the table or in the form preview.

database table students.profile: Image

form: Image

table column: Image

img src: Image

Expected behavior

After uploading a private image, the file should be saved to the correct storage path, and the image should be visible in the table and form preview without any manual intervention.

Steps to reproduce

Steps to reproduce:

  • Create a form field using FileUpload with visibility('private').
  • Upload an image using the form.
  • Save the form.
  • Check the database - the image path is saved correctly.
  • Check the storage/private or storage/local directory - the file is missing.
  • Visit the table or edit form - the image does not render.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/JayDoesPHP/filament-private-image-bug.git

Relevant log output


arxjei avatar Apr 28 '25 02:04 arxjei

My first thought was that visibility works only with services that actually support private files such as S3: https://filamentphp.com/docs/3.x/panels/installation#using-a-production-ready-storage-disk

But I found this article on how to enable temporary URLs with the local disk: https://dev.to/abrardev99/laravel-temporary-url-for-local-storage-driver-50of

Filament uses the disk's temporary URL thing. Let me know if that helps!

Saad5400 avatar May 04 '25 14:05 Saad5400

Thanks @Saad5400, that is correct!

danharrin avatar Jun 23 '25 13:06 danharrin