Skip to content

Commit 2932ced

Browse files
committed
Removed the default setting for db prefix.
Signed-off-by: Joshua Parker <[email protected]>
1 parent aa7c516 commit 2932ced

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

Application.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use Qubus\Injector\ServiceProvider\Serviceable;
2727
use ReflectionException;
2828

29-
use function Codefy\Framework\Helpers\env;
3029
use function get_class;
3130
use function is_string;
3231
use function rtrim;
@@ -153,7 +152,7 @@ public function getDbConnection(): Connection
153152
/** @var ConfigContainer $config */
154153
$config = $this->make(name: 'codefy.config');
155154

156-
$connection = env(key: 'DB_CONNECTION', default: 'default');
155+
$connection = $config->getConfigKey(key: 'database.default');
157156

158157
return DB::connection([
159158
'driver' => $config->getConfigKey(key: "database.connections.{$connection}.driver"),
@@ -167,7 +166,6 @@ public function getDbConnection(): Connection
167166
'username' => $config->getConfigKey(key: "database.connections.{$connection}.username"),
168167
'password' => $config->getConfigKey(key: "database.connections.{$connection}.password"),
169168
'dbname' => $config->getConfigKey(key: "database.connections.{$connection}.dbname"),
170-
'prefix' => $config->getConfigKey(key: "database.connections.{$connection}.prefix", default: ''),
171169
]);
172170
}
173171

@@ -177,15 +175,7 @@ public function getDbConnection(): Connection
177175
*/
178176
public function getDB(): ?OrmBuilder
179177
{
180-
/** @var ConfigContainer $config */
181-
$config = $this->make(name: 'codefy.config');
182-
183-
$connection = env(key: 'DB_CONNECTION', default: 'default');
184-
185-
return new OrmBuilder(
186-
connection: $this->getDbConnection(),
187-
tablePrefix: $config->getConfigKey(key: "database.connections.{$connection}.prefix", default: '')
188-
);
178+
return new OrmBuilder(connection: $this->getDbConnection());
189179
}
190180

191181
/**

0 commit comments

Comments
 (0)