Skip to content

Instantly share code, notes, and snippets.

@eduardocruz
Created October 29, 2014 20:11
Show Gist options
  • Save eduardocruz/bdee2129c2f3ea11d59e to your computer and use it in GitHub Desktop.
Save eduardocruz/bdee2129c2f3ea11d59e to your computer and use it in GitHub Desktop.
Laravel Dynamimc Database configuration
Config::set('database.connections.dbconnection', array(
'driver' => 'mysql',
'host' => $host,
'database' => $nome_banco,
'username' => $login,
'password' => $senha,
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => '',
));
Config::set('database.default', 'dbconnection');
$users = DB::select('SELECT * FROM usuarios');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment