Voyager: Failed to Remove Menu Item from Menu Builder

Created on 8 Apr 2019  路  6Comments  路  Source: the-control-group/voyager

Version information

  • Laravel: v5.8
  • Voyager: v1.2
  • PHP: v7.1.3
  • Database: MySQL v5.7.24

Description

I Removed Menu Item from Menu builder. It is also deleted from Database but the View is Still Rendering that Menu Item and Menu Builder Shows Deleted Item Entry. When I tried to delete it again, it throws 404 error.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Make Clean Install of Laravel and Install Voyeger.
  2. Go to the Database and Create a Table.
  3. Go to BREAD Builder and Generate BREAD for the Recently added table. It will automatically add menu item entry.
  4. Go to Menu Builder and Delete that Generated Menu Item and Refresh the Page.
  5. You will see, that menu item is still rendering.

Expected behavior

As it's already deleted from menu builder, it should not be rendered in Side Bar menu.

Additional context

I Tried clearing View Cache by running php artisan view:clear but the problem is still there.

possible bug

Most helpful comment

Run these commands php artisan view:clear and php artisan cache:clear

All 6 comments

I had same issue, deleting cache helped, but still it is bug that has to be fixed..

@vkiranmaniya it is not view cache, storage/framework/cache/data. Delete the folder and it will be fixed..

Run these commands php artisan view:clear and php artisan cache:clear

VoyagerMenuController.php line 22
public function delete_menu($menu, $id)
{
$item = Voyager::model('MenuItem')->findOrFail($id);

    $this->authorize('delete', $item);

    $item->deleteAttributeTranslation('title');

    $item->destroy($id);

   \Artisan::call('cache:clear'); // clear cache command

    return redirect()
        ->route('voyager.menus.builder', [$menu])
        ->with([
            'message'    => __('voyager::menu_builder.successfully_deleted'),
            'alert-type' => 'success',
        ]);
}

VoyagerMenuController.php ligne 22
fonction publique delete_menu ($ menu, $ id)
{
$ item = Voyager :: model ('MenuItem') -> findOrFail ($ id);

    $this->authorize('delete', $item);

    $item->deleteAttributeTranslation('title');

    $item->destroy($id);

   \Artisan::call('cache:clear'); // clear cache command

    return redirect()
        ->route('voyager.menus.builder', [$menu])
        ->with([
            'message'    => __('voyager::menu_builder.successfully_deleted'),
            'alert-type' => 'success',
        ]);
}

Merci bro tu as g茅r茅 !!!!

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings