/** * Make a menu item. * * @param array $attributes * @param \Closure $callback * * @return \Arcanedev\Menus\Entities\MenuItem */ private function makeItem(array $attributes, Closure $callback = null) { $item = MenuItem::make($attributes); if (!is_null($callback)) { call_user_func($callback, $item); } return $item; }
/** * Make an parent item and add it to the menu. * * @param string $type * @param array $properties * @param Closure|null $callback * * @return MenuItem */ private function makeItem($type, $properties = [], Closure $callback = null) { $properties = array_merge($properties, ['type' => $type, 'root' => true]); $item = MenuItem::make($properties, $callback); $this->addItem($item); return $item; }