laravelvoyager

How can I remove these things from the side menu?


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://i.sstatic.net/rx5zV.jpg


Solution

  • 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