public function compose() { foreach ($this->menu->all() as $menu) { $menuTree = $this->menuItem->getTreeForMenu($menu->id); Menu::create($menu->name, function (Builder $menu) use($menuTree) { foreach ($menuTree as $menuItem) { $this->addItemToMenu($menuItem, $menu); } }); } }
/** * */ private function emptyMenuTable() { foreach ($this->menu->all() as $menu) { $this->menu->destroy($menu); } }
public function destroy(Menu $menu) { $this->menu->destroy($menu); flash(trans('menu::messages.menu deleted')); return redirect()->route('admin.menu.menu.index'); }
/** * Get all online menus * @return object */ public function allOnline() { return $this->cache->tags($this->entityName, 'global')->remember("{$this->locale}.{$this->entityName}.allOnline", $this->cacheTime, function () { return $this->repository->allOnline(); }); }