From 98b213bb62217f26b2c6528bc3657309e4c6b55d Mon Sep 17 00:00:00 2001 From: James Brooks Date: Tue, 3 Jan 2017 14:23:30 +0000 Subject: [PATCH] Get a fresh configuration --- app/Console/Commands/InstallCommand.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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. *