Commit 34be56d1 authored by Nicolas Widart's avatar Nicolas Widart

Add the database credentials to laravel config

parent 2770200c
......@@ -149,6 +149,7 @@ class InstallCommand extends Command
$databaseUsername = $this->ask('Enter your database username');
$databasePassword = $this->secret('Enter your database password');
$this->setLaravelConfiguration($databaseName, $databaseUsername, $databasePassword);
$this->configureEnvironmentFile($databaseName, $databaseUsername, $databasePassword);
}
......@@ -181,4 +182,17 @@ class InstallCommand extends Command
$this->info('Environment file written');
}
/**
* Set DB credentials to laravel config
* @param $databaseName
* @param $databaseUsername
* @param $databasePassword
*/
private function setLaravelConfiguration($databaseName, $databaseUsername, $databasePassword)
{
$this->laravel['config']['database.connections.mysql.database'] = $databaseName;
$this->laravel['config']['database.connections.mysql.username'] = $databaseUsername;
$this->laravel['config']['database.connections.mysql.password'] = $databasePassword;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment