This is better inline solution to not displaying Admin Menus

by @Leesneaks
This commit is contained in:
slawkens 2020-10-12 22:46:44 +02:00
parent 928de13459
commit ea8ae2372e
2 changed files with 2 additions and 7 deletions

View File

@ -1,14 +1,9 @@
<?php
$mailer = [];
if(config('mail_enabled')) {
$mailer = ['name' => 'Mailer', 'icon' => 'envelope', 'link' => 'mailer'];
}
return [
['name' => 'Dashboard', 'icon' => 'tachometer-alt', 'link' => 'dashboard'],
['name' => 'News', 'icon' => 'newspaper', 'link' => 'news'],
$mailer,
['name' => 'Mailer', 'icon' => 'envelope', 'link' => 'mailer', 'disabled' => !config('mail_enabled')],
['name' => 'Pages', 'icon' => 'book', 'link' =>
[
['name' => 'All Pages', 'link' => 'pages'],

View File

@ -48,7 +48,7 @@
$menus = require __DIR__ . '/menus.php';
foreach ($menus as $category => $menu) {
if (!isset($menu['name'])) {
if (isset($menu['disabled']) && $menu['disabled']) {
continue;
}