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.
24 Replies
read the doc
what you showing is
infolist
defined in your Resource classlook at the
form
Something like this might help you:
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)
or customize in your create page class
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
Just add the disabled part I commented π
like i have some other stuff that i want to change
ok
You can do like this, disable file upload in edit page, and use
placeholder()
or others to show the same image in edit pageany 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
disable part is like ModestasV answer, and about placeholder you can ref this https://filamentphp.com/docs/3.x/forms/layout/placeholder
use a custom field then https://filamentphp.com/docs/3.x/forms/fields/custom
v2
?
please use the search on the site
just check docs dude..
ok
we are not your chatgpt or search engine
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
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
when i click on this image
Then you have to give action to image, on click you open modal with upload form, this may achieve what you want
ok let me try