@@ -62,13 +62,13 @@ public function handle(Filesystem $filesystem, Dumper $dumper)
6262 {
6363 $ this ->info ('Restoring Database ' );
6464
65- $ hostname = config ('database.connections.mysql.host ' , '127.0.0.1 ' );
66- $ port = config ('database.connections.mysql.port ' , '3306 ' );
67- $ database = config ('database.connections.mysql.database ' , 'dbm ' );
68- $ username = config ('database.connections.mysql.username ' , 'root ' );
69- $ password = config ('database.connections.mysql.password ' , '' );
70-
7165 $ driver = dbm_driver ();
66+ $ hostname = config ('database.connections. ' .$ driver .'.host ' , '127.0.0.1 ' );
67+ $ port = config ('database.connections. ' .$ driver .'.port ' , '3306 ' );
68+ $ database = config ('database.connections. ' .$ driver .'.database ' , 'dbm ' );
69+ $ username = config ('database.connections. ' .$ driver .'.username ' , 'root ' );
70+ $ password = config ('database.connections. ' .$ driver .'.password ' , '' );
71+
7272 $ directory = 'backups ' .DIRECTORY_SEPARATOR .$ driver ;
7373
7474 if ($ this ->option ('path ' ) != null ) {
@@ -87,6 +87,12 @@ public function handle(Filesystem $filesystem, Dumper $dumper)
8787 $ compressExtension = config ('dbm.backup.compress_extension ' , '.gz ' );
8888 $ dumpBinaryPath = config ('dbm.backup. ' .$ driver .'.binary_path ' , '' );
8989
90+ $ dumper ->setHost ($ hostname )
91+ ->setPort ($ port )
92+ ->setDbName ($ database )
93+ ->setUserName ($ username )
94+ ->setPassword ($ password );
95+
9096 try {
9197 switch ($ driver ) {
9298 case 'mongodb ' :
0 commit comments