File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ public function __construct(array $config)
66
66
// Select database
67
67
$ this ->db = $ this ->connection ->selectDatabase ($ this ->getDefaultDatabaseName ($ dsn , $ config ));
68
68
69
+ $ this ->tablePrefix = $ config ['prefix ' ] ?? '' ;
70
+
69
71
$ this ->useDefaultPostProcessor ();
70
72
71
73
$ this ->useDefaultSchemaGrammar ();
@@ -84,7 +86,7 @@ public function collection($collection)
84
86
{
85
87
$ query = new Query \Builder ($ this , $ this ->getQueryGrammar (), $ this ->getPostProcessor ());
86
88
87
- return $ query ->from ($ collection );
89
+ return $ query ->from ($ this -> tablePrefix . $ collection );
88
90
}
89
91
90
92
/**
@@ -109,7 +111,7 @@ public function table($table, $as = null)
109
111
*/
110
112
public function getCollection ($ name )
111
113
{
112
- return new Collection ($ this , $ this ->db ->selectCollection ($ name ));
114
+ return new Collection ($ this , $ this ->db ->selectCollection ($ this -> tablePrefix . $ name ));
113
115
}
114
116
115
117
/** @inheritdoc */
You can’t perform that action at this time.
0 commit comments