diff --git a/app/Console/Commands/InstallCommand.php b/app/Console/Commands/InstallCommand.php index 1f7c1716..58f04452 100644 --- a/app/Console/Commands/InstallCommand.php +++ b/app/Console/Commands/InstallCommand.php @@ -362,6 +362,12 @@ class InstallCommand extends Command return; } + // We need to refresh the config to get access to the newly connected database. + $this->getFreshConfiguration(); + + // Now we need to install the application. + $this->call('app:install'); + $user = [ 'username' => $this->ask('Please enter your username'), 'email' => $this->ask('Please enter your email'), @@ -412,6 +418,18 @@ class InstallCommand extends Command $this->table(['Setting', 'Value'], $configRows); } + /** + * Boot a fresh copy of the application configuration. + * + * @return void + */ + protected function getFreshConfiguration() + { + $app = require $this->laravel->bootstrapPath().'/app.php'; + + $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); + } + /** * Writes to the .env file with given parameters. *