diff --git a/app/Console/Commands/InstallCommand.php b/app/Console/Commands/InstallCommand.php index d8b35ce17c76..a43d28cc9383 100644 --- a/app/Console/Commands/InstallCommand.php +++ b/app/Console/Commands/InstallCommand.php @@ -312,6 +312,12 @@ protected function configureUser() 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'), @@ -362,6 +368,18 @@ protected function formatConfigsTable(array $config) $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. *