FileUpload Edit Page Preview

i have an image in my local storage and some other stuffs so i wnt only edit those other stuffs in the edit page but the image should not edit only for view like this.
No description
24 Replies
wyChoong
wyChoong2y ago
read the doc what you showing is infolist defined in your Resource class
wyChoong
wyChoong2y ago
look at the form
ModestasV
ModestasV2y ago
Something like this might help you:
Forms\Components\TextInput::make('email')
->disabled(function ($context) {
return $context === 'edit';
})
Forms\Components\TextInput::make('email')
->disabled(function ($context) {
return $context === 'edit';
})
This allows you to disable the image input on edit page. You can do this with hide method too (or any other closure accepting method)
wyChoong
wyChoong2y ago
or customize in your create page class
AliBabba420
AliBabba420OP2y ago
no for refernce i upload this image but i want exactly same the image in my edit page no i only want to disable the edit for the image
ModestasV
ModestasV2y ago
Just add the disabled part I commented 🙂
AliBabba420
AliBabba420OP2y ago
like i have some other stuff that i want to change ok
ModestasV
ModestasV2y ago
->disabled(function ($context) {
return $context === 'edit';
})
->disabled(function ($context) {
return $context === 'edit';
})
Vp
Vp2y ago
You can do like this, disable file upload in edit page, and use placeholder() or others to show the same image in edit page
AliBabba420
AliBabba420OP2y ago
any reference code i tried but the edit but will show and i dont want that i want to show the image clear like in the above image i upload
Vp
Vp2y ago
disable part is like ModestasV answer, and about placeholder you can ref this https://filamentphp.com/docs/3.x/forms/layout/placeholder
AliBabba420
AliBabba420OP2y ago
v2 ?
wyChoong
wyChoong2y ago
please use the search on the site
Vp
Vp2y ago
just check docs dude..
AliBabba420
AliBabba420OP2y ago
ok
wyChoong
wyChoong2y ago
we are not your chatgpt or search engine
AliBabba420
AliBabba420OP2y ago
Placeholder::make('logo') ->content(function(Closure $get){ $logo=$get('logo'); return new HtmlString("<img src=$logo>"); })->disableLabel() i figure it out how can we only show images in the placeholder in the edit form now i have doubt that like this image preview can i edit that image or not any idea
AliBabba420
AliBabba420OP2y ago
i dont want that default fileupload preview for this image i want it should look like this but i also want to edit in the edit form
No description
AliBabba420
AliBabba420OP2y ago
when i click on this image
Vp
Vp2y ago
Then you have to give action to image, on click you open modal with upload form, this may achieve what you want
AliBabba420
AliBabba420OP2y ago
ok let me try

Did you find this page helpful?