/** * Create a new menu. * * @return $this */ public function create() { $menu = $this->handler->add($this->name, $this->getAttribute('position'))->title($this->getAttribute('title'))->link($this->getAttribute('link'))->handles(Arr::get($this->menu, 'link')); $this->attachIcon($menu); $this->handleNestedMenu(); return $this; }
/** * Create a new menu. * * @param string|null $id * * @return \Illuminate\Support\Fluent|null */ protected function createMenu($id = null) { if (is_null($id)) { $id = $this->getAttribute('id'); } return $this->handler->add($id, $this->getAttribute('position'))->title($this->getAttribute('title'))->link($this->getAttribute('link'))->handles(Arr::get($this->menu, 'link')); }