From f0ffe17cc3a9d6cd76375eceef64ef2a24de511f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 4 Jul 2019 12:12:29 +0200 Subject: [PATCH] #2843 --- composer.json | 5 ++++- src/app/Magic/CubistMenu.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 09c2cec..3695cfa 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,10 @@ "laravel": { "providers": [ "Cubist\\Backpack\\CubistBackpackServiceProvider" - ] + ], + "aliases": { + "Menu": "Cubist\\Backpack\\App\\CubistMenu" + } } }, "repositories": [ diff --git a/src/app/Magic/CubistMenu.php b/src/app/Magic/CubistMenu.php index 351bde0..c6e788d 100644 --- a/src/app/Magic/CubistMenu.php +++ b/src/app/Magic/CubistMenu.php @@ -9,13 +9,13 @@ class CubistMenu extends Menu { public function get($key) { - if (!self::exists($key)) { - self::makeAllMenus(); + if (!$this->exists($key)) { + $this->makeAllMenus(); } return parent::get($key); } - public static function makeAllMenus() + public function makeAllMenus() { $tree = CMSPage::getTree(); foreach ($tree as $mainKey => $main) { -- 2.39.5