如何从侧面菜单中删除这些内容? [英] How can I remove these things from the side menu?
问题描述
问题出在基于php laravel的管理面板Voyager上.因此,当我创建数据库并继续添加BREAD时,如果删除它,则侧边栏上的名称仍然保留.您碰巧知道如何删除它.我尝试遍历可以保存信息的大多数文件,但是什么也没找到.它也不会保存在数据库中.这是问题的图像: https://imgur.com/43121Y2
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
推荐答案
Voyager菜单是从缓存中检索到的,因此这就是即使在数据库中删除后仍然显示它的原因.
这是实际上显示
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();
});
.......
}
请注意Cache门面如何记住30天的菜单项.
这是一个已知问题,此处,并且此修复程序已在v1中发布.2.4
手动修剪缓存所需要做的就是
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
希望这会有所帮助
这篇关于如何从侧面菜单中删除这些内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!