Set order of backend menu items
0
Especially with larger projects, it makes sense to sort the backend menu items.
Blinks4451850
and mjauvin
have developed a clear variant to control the order:
Event::listen('backend.menu.extendItems', function ($manager) {
$items = $manager->listMainMenuItems();
$data = [
'October.Backend.Media',
'October.Backend.Dashboard',
'October.Cms.cms',
'RainLab.Builder.Builder',
];
$i = 0;
foreach ($data as $name) {
if ($item = array_get($items, strtoupper($name), false)) {
$item->order = $i;
$i++;
}
}
});
There are no comments yet
Be the first one to comment