| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 8 | ||
| Bugs | 4 | Features | 0 |
| 1 | <?php |
||
| 10 | public function getConnectionName() |
||
| 11 | { |
||
| 12 | if (! App::runningUnitTests() && Auth::check()) { |
||
| 13 | $user = \Auth::user(); |
||
| 14 | $role_id = $user->role_id; |
||
| 15 | if ($user->isAdmin()) { |
||
| 16 | return env('DB_DATABASE', 'genealogy'); //'enso'); |
||
| 17 | } |
||
| 18 | if (session()->get('db')) { |
||
| 19 | return 'tenantdb'; |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | return $this->connection; |
||
| 24 | } |
||
| 26 |