We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec5dcea commit 58aae1eCopy full SHA for 58aae1e
src/Services/ModelService.php
@@ -23,9 +23,10 @@ public function setModel($model)
23
24
$this->model = $model;
25
26
- $this->connectionName = $modelInstance->getConnectionName();
+ $this->connectionName = $modelInstance->getConnectionName() !== null ?
27
+ $modelInstance->getConnectionName() : config('database.default');
28
- $this->tableName = $modelInstance->getTable();
29
+ $this->tableName = config("database.connections.$this->connectionName.prefix", '').$modelInstance->getTable();
30
31
$this->indexName = $modelInstance->searchableAs();
32
0 commit comments