runcmf / runtracy

Tracy Debugger Bar for Slim Framework
Apache License 2.0
73 stars 15 forks source link

Error when using different connection name (!= "default") in eloquent #16

Open kimjohans opened 5 years ago

kimjohans commented 5 years ago

In my slim project, the default connection has another name (no needs to discuss why, btw), and i am using multiple connections. For handling those connections i use the Illuminate\Database\Capsule\Manager.

Is there a config/setting in runtracy to modify/pass the correct connection ? because currently the app is crashing when i am enabling the "Eloquent ORM Panel" panel:

`Slim Application Error: Type: InvalidArgumentException\nMessage: Database [default] not configured. File: /vendor/illuminate/database/DatabaseManager.php Line: 140 Trace: #0 /vendor/illuminate/database/DatabaseManager.php(103): Illuminate\Database\DatabaseManager->configuration('default')

1 /vendor/illuminate/database/DatabaseManager.php(74): Illuminate\Database\DatabaseManager->makeConnection('default')

2 /vendor/illuminate/database/Capsule/Manager.php(108): Illuminate\Database\DatabaseManager->connection('default')

3 /vendor/illuminate/database/Capsule/Manager.php(74): Illuminate\Database\Capsule\Manager->getConnection(NULL)

4 /vendor/illuminate/database/Capsule/Manager.php(199): Illuminate\Database\Capsule\Manager::connection()

5 /vendor/runcmf/runtracy/src/RunTracy/Middlewares/TracyMiddleware.php(72): Illuminate\Database\Capsule\Manager::__callStatic('getQueryLog', Array)

`

This error occurrs, because within the TracyMiddleware (Line 72) the plugin tries to connect without any name, so the DB manager is taking "default" :(

Thank you.

kimjohans commented 5 years ago

Setting the default within the config does not solve the problem:

"database" => array( "default" => "db_system" ),