diff --git a/src/NewCommand.php b/src/NewCommand.php index 77a12298..f7524b7e 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -98,17 +98,19 @@ protected function execute(InputInterface $input, OutputInterface $output) } if ($this->runCommands($commands, $input, $output)->isSuccessful()) { - $this->replaceInFile( - 'APP_URL=http://localhost', - 'APP_URL=http://'.$name.'.test', - $directory.'/.env' - ); - - $this->replaceInFile( - 'DB_DATABASE=laravel', - 'DB_DATABASE='.str_replace('-', '_', strtolower($name)), - $directory.'/.env' - ); + if ($name && $name !== '.') { + $this->replaceInFile( + 'APP_URL=http://localhost', + 'APP_URL=http://'.$name.'.test', + $directory.'/.env' + ); + + $this->replaceInFile( + 'DB_DATABASE=laravel', + 'DB_DATABASE='.str_replace('-', '_', strtolower($name)), + $directory.'/.env' + ); + } if ($input->getOption('jet')) { $this->installJetstream($directory, $stack, $teams, $input, $output);