How can I remove these things from the side menu?

妖精的绣舞 提交于 2019-12-11 15:52:45

问题


The problem is regarding the admin panel Voyager who is based on php laravel. So when I create database and follow up with adding BREAD, if I delete it, the name on the sidebar remains. Do you happen to know how I can delete it. I have tried going through most files where the info could be saved, but found nothing. It is not saved in the database either. Here is the image of the problem: https://imgur.com/43121Y2


回答1:


The Voyager Menu is retrieved from the cache so this is why it still shows up even after being deleted in the Database.
Here's the function that actually displays the menu items from Voyager Source

public static function display($menuName, $type = null, array $options = [])
{
        // GET THE MENU - sort collection in blade
        $menu = \Cache::remember('voyager_menu_'.$menuName, \Carbon\Carbon::now()->addDays(30), function () use ($menuName) {
            return static::where('name', '=', $menuName)
            ->with(['parent_items.children' => function ($q) {
                $q->orderBy('order');
            }])
            ->first();
        });
    .......
}

Note how the Cache facade is remembering the menu items for 30 days.
This is a known issue solved here and the fix was released in v1.2.4
All you have to do to manually prune the cache is

php artisan cache:clear

Hope this helps



来源:https://stackoverflow.com/questions/58042991/how-can-i-remove-these-things-from-the-side-menu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!