Código PHP :
'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], 'functions' => [ 'driver' => 'mysql', 'host' => env('FUNCTIONS_HOST', '127.0.0.1'), 'port' => env('FUNCTIONS_PORT', '3306'), 'database' => '', 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ],
no he logrado realizar la carga de nombre de base de datos dependiendo el usuario. en php lo probe de esta manera
Código PHP :
$bd = "bacoopco_".$_SESSION["bbdduser"]; $pass = ""; $user="root"; $mysqli = new mysqli('localhost', $user, $pass, $bd); if($mysqli->connect_error){ die('Error en la conexion' . $mysqli->connect_error); }
pero en laravel no he logrado hacer algo asi.