Skip to content

Instantly share code, notes, and snippets.

@sampoyigi
Created December 17, 2020 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sampoyigi/d80afd1b031634772ea9af6712093b25 to your computer and use it in GitHub Desktop.
Save sampoyigi/d80afd1b031634772ea9af6712093b25 to your computer and use it in GitHub Desktop.
Sample of adding/removing admin navigation items
// Taken from \Admin\ServiceProvider::replaceNavMenuItem
AdminMenu::registerCallback(function (Navigation $manager) {
// Change nav menu if single location mode is activated
if (AdminLocation::check()) {
$manager->mergeNavItem('locations', [
'href' => admin_url('locations/settings'),
'title' => lang('admin::lang.side_menu.setting'),
], 'restaurant');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment