diff --git a/app/Commands/NginxVhostsCommand.php b/app/Commands/NginxVhostsCommand.php index e28e3b0..549b38c 100644 --- a/app/Commands/NginxVhostsCommand.php +++ b/app/Commands/NginxVhostsCommand.php @@ -131,7 +131,14 @@ class NginxVhostsCommand extends Command // input domain ->addItem('domain: -', function(CliMenu $menu) use (&$configuration) { - $result = $menu->askText()->ask(); + + $input = $menu->askText(); + + if ($configuration['domain']) { + $input->setPlaceholderText($configuration['domain']); + } + + $result = $input->ask(); $configuration['domain'] = $result->fetch(); $menu->getSelectedItem()->setText('domain: '.$result->fetch()); @@ -140,7 +147,14 @@ class NginxVhostsCommand extends Command // input root ->addItem('root: -', function(CliMenu $menu) use (&$configuration) { - $result = $menu->askText()->ask(); + + $input = $menu->askText(); + + if ($configuration['root']) { + $input->setPlaceholderText($configuration['root']); + } + + $result = $input->ask(); $configuration['root'] = $result->fetch(); $menu->getSelectedItem()->setText('root: '.$result->fetch()); @@ -149,7 +163,14 @@ class NginxVhostsCommand extends Command // input index ->addItem('index: '.$configuration['index'], function(CliMenu $menu) use (&$configuration) { - $result = $menu->askText()->ask(); + + $input = $menu->askText(); + + if ($configuration['index']) { + $input->setPlaceholderText($configuration['index']); + } + + $result = $input->ask(); $configuration['index'] = $result->fetch(); $menu->getSelectedItem()->setText('index: '.$result->fetch()); @@ -204,7 +225,7 @@ class NginxVhostsCommand extends Command $bladeFile->put($template['name'], '/etc/nginx/sites-available/'.$filename, $configuration); $menu->confirm('Success!')->display('Ok!'); - // invoke action + // invoke action $action = new NginxVhostGoBackAction(); is_callable($action($menu)); }