F
Filament4w ago
Vp

How can I have correct images

I have this file uploads with image display:
FileUpload::make('avatar')
->image()
->directory('avatar')
// ->disk('public')
// ->visibility('public')
->required(),

ImageEntry::make('avatar')
->circular()
->size(64),

ImageColumn::make('avatar')
->circular()
->size(40),
FileUpload::make('avatar')
->image()
->directory('avatar')
// ->disk('public')
// ->visibility('public')
->required(),

ImageEntry::make('avatar')
->circular()
->size(64),

ImageColumn::make('avatar')
->circular()
->size(40),
And below is how I switch around visibility and disk: ->visibility('public') only 1. On ImageEntry ✅ 2. On FileUpload edit ❌ [403 (Forbidden)] ->disk('public') only 1. On ImageEntry ❌ // No error, just empty 2. On FileUpload edit ✅ both ->disk('public') & ->visibility('public') Same as ->disk('public') only default (without disk and visibility) 1. On ImageEntry ✅ 2. On FileUpload edit ✅ ImageColumn The image represents how ImageColumn displays based on how we store, all are same and just string. On my use case, I will need ->disk('public') only because it set visibility to public as well, so how can I display correct images on panel Or should I use default (which display correct for infolist and form) and use temporaryUrl for public facing app Any advice is appreciate, thanks
No description
3 Replies
toeknee
toeknee4w ago
What is disk public? Is it a local storage disk? generally public facing apps get temporaryUrl when using cloud storage
iamgeor.ge
iamgeor.ge4w ago
add this ->disk('public'), also in .env 127.0.0.1:8000 instead of localhost
Vp
VpOP4w ago
disk public is same as FILESYSTEM_DISK=public on .env, my apps will be very small and I will not need cloud storage yet.. I want to store images publicly so that I can show on frontpage easily. I'll try to override image display on panel or not show at some..

Did you find this page helpful?