some fix
This commit is contained in:
@ -14,7 +14,7 @@ use kernel\models\Menu;
|
||||
|
||||
$table = new ViewEloquentTable(new ViewJsonTableEloquentModel($menu, [
|
||||
'params' => ["class" => "table table-bordered", "border" => "2"],
|
||||
'baseUrl' => "/admin/menu",
|
||||
'baseUrl' => "/admin/settings/menu",
|
||||
]));
|
||||
|
||||
$table->beforePrint(function () use ($menu) {
|
||||
@ -27,21 +27,7 @@ $table->rows([
|
||||
'parent_id' => (function ($data) {
|
||||
if ($data == 0) return null;
|
||||
return Menu::find($data)->label;
|
||||
}),
|
||||
'created_at' => function ($data) {
|
||||
if (!$data){
|
||||
return null;
|
||||
}
|
||||
|
||||
return (new DateTimeImmutable($data))->format("d-m-Y");
|
||||
},
|
||||
'updated_at' => function ($data) {
|
||||
if (!$data){
|
||||
return null;
|
||||
}
|
||||
|
||||
return (new DateTimeImmutable($data))->format("d-m-Y");
|
||||
}
|
||||
})
|
||||
]);
|
||||
$table->create();
|
||||
$table->render();
|
Reference in New Issue
Block a user