protected function setupDatabase()
{
$databaseNotInstalled = true;
$type = $this->env('DB_DEFAULT', 'mysql');
$host = $this->env('DB_HOST', 'localhost');
$name = $this->env('DB_DATABASE', 'devisephp');
$user = $this->env('DB_USERNAME', 'root');
$pass = $this->env('DB_PASSWORD', '');
$migrations = $this->env('APP_MIGRATIONS', 'yes');
$seeds = $this->env('APP_SEEDS', 'yes');
while ($databaseNotInstalled) {
$type = $this->io()->askAboutDatabaseType($type);
$host = $this->io()->askAboutDatabaseHost($host);
$name = $this->io()->askAboutDatabaseName($name);
$user = $this->io()->askAboutDatabaseUser($user);
$pass = $this->io()->askAboutDatabasePass($pass);
$migrations = $this->io()->askAboutDatabaseMigrations($migrations);
$seeds = $this->io()->askAboutDatabaseSeeds($seeds);
$this->wizard()->saveDatabase($type, $host, $name, $user, $pass);
$this->wizard()->saveApplicationMigrationAndSeedSettings($migrations, $seeds);
if ($this->wizard()->errors) {
$this->spitOutErrors($this->wizard->errors->all());
} else {
$databaseNotInstalled = false;
}
}
}