Support the ongoing development of Laravel.io →
Input Database
Last updated 2 years ago.
0

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'));
0

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.

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.