Hi, I want to add a link to a column in resource datattable, that column is an image, I want to show the image on click of the image name, here is the code given below I am using
protected function fields()
{
return [
ID::create("id")
->showOnCreate(0)
->sortable(true),
Text::create("name")
->validators([
RequiredFieldValidator::create()
->errorMessage("Please enter name"),
])
->searchable(true)
->sortable(true),
Text::create("upload_file")
->inputWidget(
FileUploader::create()
->saveToFolder('uploads')
->accept(["pdf", "csv", "jpg", "png"])
->imagePreview(true)
->previewWidth("100px")
->previewHeight("100px")
),
DateTime::create("created_at")
->baseFormat("Y-m-d H:i:s")->displayFormat("Y-m-d H:i:s")
->sortable(true),
DateTime::create("updated_at")
->baseFormat("Y-m-d H:i:s")->displayFormat("Y-m-d H:i:s")
->sortable(true),
];
}
I want to make upload_file as a link to that file, from data table in resource
Text::create("upload_file")
->inputWidget(
FileUploader::create()
->saveToFolder('uploads')
->accept(["pdf", "csv", "jpg", "png"])
->imagePreview(true)
->previewWidth("100px")
->previewHeight("100px")
),