Exemplo n.º 1
0
 public function edit(Menu $menu)
 {
     Breadcrumbs::addCrumb(trans('menu::menu.breadcrumb.edit menu'));
     $menuItems = $this->menuItem->allRootsForMenu($menu->id);
     $menuStructure = $this->menuRenderer->renderForMenu($menu->id, $menuItems->nest());
     return view('menu::admin.menus.edit', compact('menu', 'menuStructure'));
 }
Exemplo n.º 2
0
 public function edit(Menu $menu)
 {
     $menuItems = $this->menuItem->allRootsForMenu($menu->id);
     $menuStructure = $this->menuRenderer->renderForMenu($menu->id, $menuItems->nest());
     $data = compact('menu', 'menuStructure');
     if (is_module_enabled('Site')) {
         $data['supportedLocales'] = \Site::current()->siteLocales->lists('title', 'locale')->toArray();
     }
     return view('menu::admin.menus.edit', $data);
 }
Exemplo n.º 3
0
 /**
  * Get all root elements
  *
  * @param  int    $menuId
  * @return object
  */
 public function allRootsForMenu($menuId)
 {
     return $this->cache->tags($this->entityName, 'global')->remember("{$this->locale}.{$this->entityName}.allRootsForMenu.{$menuId}", $this->cacheTime, function () use($menuId) {
         return $this->repository->allRootsForMenu($menuId);
     });
 }