some fix
This commit is contained in:
@ -23,20 +23,6 @@ $table->columns([
|
||||
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->beforePrint(function () {
|
||||
return PrimaryBtn::create("Создать", "/admin/settings/menu/create")->fetch();
|
||||
|
@ -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();
|
@ -35,7 +35,7 @@ class MenuService
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getActiveStatus($url)
|
||||
public static function isActive($url): bool
|
||||
{
|
||||
if ($url === Request::getUrlPath()){
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user