File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Illuminate/Database/Console Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ class DbCommand extends Command
1414 *
1515 * @var string
1616 */
17- protected $ signature = 'db {connection? : The database connection that should be used} ' ;
17+ protected $ signature = 'db {connection? : The database connection that should be used}
18+ {--read : Connect to the read connection}
19+ {--write : Connect to the write connection} ' ;
1820
1921 /**
2022 * The console command description.
@@ -64,6 +66,12 @@ public function getConnection()
6466 $ connection = (new ConfigurationUrlParser )->parseConfiguration ($ connection );
6567 }
6668
69+ if ($ this ->option ('read ' )) {
70+ $ connection = array_merge ($ connection , $ connection ['read ' ]);
71+ } elseif ($ this ->option ('write ' )) {
72+ $ connection = array_merge ($ connection , $ connection ['write ' ]);
73+ }
74+
6775 return $ connection ;
6876 }
6977
You can’t perform that action at this time.
0 commit comments