My project has two databases: one bank for user accounts and one for the project domain. My need is to define the database that Auth
uses for authentication, because in the default configuration the domain database is defined.
return array(
'default' => 'mysql_domain',
I wanted to change this setting to Auth
so that it does not use the domain database.
'connections' => array(
'mysql_account' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'user_agro_admin',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'mysql_domain' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'indicator_agro_admin',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
)
),
In the configuration of auth
you can only define the driver, model and table. My need could be solved only if there was the Auth::setDefaultConnection('mysql_account')
method or something similar. How to do this?
Q.: I do not want to change the default setting with the Config::set('database.fo', 'bar')
method, but rather change the database that Auth
uses!
Q.2: I use Query Builder.