F
Filamentβ€’15mo ago
AliBabba420

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
wyChoongβ€’15mo ago
read the doc what you showing is infolist defined in your Resource class
wyChoong
wyChoongβ€’15mo ago
look at the form
ModestasV
ModestasVβ€’15mo 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
wyChoongβ€’15mo ago
or customize in your create page class
AliBabba420
AliBabba420OPβ€’15mo 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
ModestasVβ€’15mo ago
Just add the disabled part I commented πŸ™‚
AliBabba420
AliBabba420OPβ€’15mo ago
like i have some other stuff that i want to change ok
ModestasV
ModestasVβ€’15mo ago
->disabled(function ($context) {
return $context === 'edit';
})
->disabled(function ($context) {
return $context === 'edit';
})
Vp
Vpβ€’15mo 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
AliBabba420OPβ€’15mo 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
Vpβ€’15mo ago
disable part is like ModestasV answer, and about placeholder you can ref this https://filamentphp.com/docs/3.x/forms/layout/placeholder
AliBabba420
AliBabba420OPβ€’15mo ago
v2 ?
wyChoong
wyChoongβ€’15mo ago
please use the search on the site
Vp
Vpβ€’15mo ago
just check docs dude..
AliBabba420
AliBabba420OPβ€’15mo ago
ok
wyChoong
wyChoongβ€’15mo ago
we are not your chatgpt or search engine
AliBabba420
AliBabba420OPβ€’15mo 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
AliBabba420OPβ€’15mo 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
AliBabba420OPβ€’15mo ago
when i click on this image
Vp
Vpβ€’15mo ago
Then you have to give action to image, on click you open modal with upload form, this may achieve what you want
AliBabba420
AliBabba420OPβ€’15mo ago
ok let me try
Want results from more Discord servers?
Add your server