Skip to content

Commit

Permalink
Get a fresh configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Jan 3, 2017
1 parent 0f3a66f commit 8588c8b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/Console/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 8588c8b

Please sign in to comment.