/** * @param Menu $menu * @param MenuItem $item * @return */ public function destroy(Menu $menu, MenuItem $item) { //make sure to load the relationships, so we can use them to make that type of resource available again. //example: when deleting a menuitem refering to a page, //we need to make the page available again in the UI. //if we load it, before deleting, the page object will be there in the response. $item->load(['page', 'page.translations', 'route', 'route.translations']); return $this->menu->deleteItem($item); }
/** * @param Menu $menu * @param Request $request */ public function sort(Menu $menu, Request $request) { $order = $request->get('order'); $this->menu->sortMenu($menu, $order); }