show img at menu

This commit is contained in:
Kavalar 2024-11-20 13:41:31 +03:00
parent 9cb82deaf8
commit a3f97456bc
2 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,9 @@ $table->columns([
if ($data == 0) return null;
return Menu::find($data)->label;
}),
'icon_file' => function ($data) {
return $data ? "<img src='$data' width='150px'>" : "";
}
]);
$table->beforePrint(function () {
return IconBtnCreateWidget::create(['url' => '/admin/settings/menu/create'])->run();

View File

@ -26,7 +26,10 @@ $table->rows([
'parent_id' => (function ($data) {
if ($data == 0) return null;
return Menu::find($data)->label;
})
}),
'icon_file' => function ($data) {
return $data ? "<img src='$data' width='300px'>" : "";
}
]);
$table->create();
$table->render();