Skip to content

Commit

Permalink
Overwrite laravel mysql connection
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Sep 9, 2017
1 parent 55fffc4 commit 05c3684
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Modules/Core/Console/Installers/Scripts/ConfigureDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository as Config;
use Illuminate\Database\Connectors\ConnectionFactory;
use Illuminate\Database\DatabaseManager;
use Modules\Core\Console\Installers\SetupScript;
use Modules\Core\Console\Installers\Writers\EnvFileWriter;
use PDOException;
Expand Down Expand Up @@ -155,6 +157,9 @@ protected function setLaravelConfiguration($driver, $host, $port, $name, $user,
$this->config['database.connections.' . $driver . '.database'] = $name;
$this->config['database.connections.' . $driver . '.username'] = $user;
$this->config['database.connections.' . $driver . '.password'] = $password;

app(DatabaseManager::class)->purge($driver);
app(ConnectionFactory::class)->make($this->config['database.connections.' . $driver], $driver);
}

/**
Expand Down

0 comments on commit 05c3684

Please sign in to comment.