Skip to content

Commit bef3f63

Browse files
committed
refactor: remover connection name from driver key in driver manager
1 parent e095355 commit bef3f63

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Generators/NovaResourceGenerator.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,16 @@ protected function commandFieldsExists(): bool
158158
return !empty(Arr::flatten($this->fields));
159159
}
160160

161-
protected function getColumnList(string $table, ?string $name = null): array
161+
protected function getColumnList(string $table, ?string $connectionName = null): array
162162
{
163-
$config = DB::connection($name)->getConfig();
164-
165-
$name = empty($name) ? "pdo_{$config['driver']}" : "pdo_{$name}";
163+
$config = DB::connection($connectionName)->getConfig();
166164

167165
$dbalConnection = DriverManager::getConnection([
168166
'dbname' => $config['database'],
169167
'user' => $config['username'],
170168
'password' => $config['password'],
171169
'host' => $config['host'],
172-
'driver' => $name,
170+
'driver' => "pdo_{$config['driver']}",
173171
]);
174172

175173
return $dbalConnection

0 commit comments

Comments
 (0)