What you can do is kind of half measure:
Config::set('database.connections.foo', [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '3306',
'database' => 'foo_db',
'username' => 'root',
'password' => 'secret',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
]);
$result = DB::connection('foo')->select('show tables'));
Hi, if u want add custom driver with database for it, jst add your custom dirver to config/database.php
and create console artisan command on run which u will modify db settings or .env
file, for example:
php artisan db:select --database=databasedriver --databasename=my_custom_database
For more info. read Artisan Laravel docs.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community