lundi 2 mai 2016

How can I list the database connections in Laravel 5?

How can I get the list of database connections in Laravel. I'm planning to load the connection names into a select box.

'connections' => [
    'sqlsrv_auth' => [
        'driver'   => 'sqlsrv',
        'host'     => env('DB_HOST', 'SQLEXPRESS'),
        'database' => env('DB_DATABASE', 'auth_db'),
        'username' => env('DB_USERNAME', 'sa'),
        'password' => env('DB_PASSWORD', '1234'),
        'charset'  => 'utf8',
        'prefix'   => '',
    ],
    'sqlsrv' => [
        'driver'   => 'sqlsrv',
        'host'     => env('DB_HOST', 'SQLEXPRESS'),
        'database' => env('DB_DATABASE', 'main_db'),
        'username' => env('DB_USERNAME', 'sa'),
        'password' => env('DB_PASSWORD', '1234'),
        'charset'  => 'utf8',
        'prefix'   => '',
    ],
    'sqlsrv_bpb' => [
        'driver'   => 'sqlsrv',
        'host'     => env('DB_HOST', '192.168.1.1'),
        'database' => env('DB_DATABASE', 'mirror'),
        'username' => env('DB_USERNAME', 'sa'),
        'password' => env('DB_PASSWORD', '1234'),
        'charest'  => 'utf8',
        'prefix'   => '',
    ]

],



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire