How can a database connection be changed when user is admin role? Admin database contains information that must not be accessible to other user's and requirement also is that database must be located on own server. I do have currently separate configuration for admin connection.
'mysql' => [
'host' => 'admin.psa44.localhost'
'driver' => 'mysql',
'database' => 'database',
'username' => 'root',
'password' => 'secretpassword',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
],
I want that no hardcoding is in application so how can Laravel do the switch when necessary? Thanks for any help.