askText(); $result = $input->ask(); $menu->redraw(); }; return $callable; } /** * * */ private function addCreateItem() { $menu = function(CliMenuBuilder $builder) { $data = []; $builder ->setTitle('Settings > Add') ->disableDefaultItems() // input name ->addItem('name', $this->addInputItem()) // input url ->addItem('url', $this->addInputItem()) ->addItem('handler', $this->addInputItem()) ->addLineBreak('-') ->addSubMenu('actions', $this->addActions()) ->addLineBreak('-'); }; return $menu; } /** * Execute the console command. * * @return mixed */ public function handle() { // create menu $builder = $this->menu('Settings'); $builder ->addSubMenu('Add', $this->addCreateItem()) ->addLineBreak('-'); $mainmenu = $builder->build(); $mainmenu->open(); } }