Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit 58aae1e

Browse files
committed
Resolves #8
1 parent ec5dcea commit 58aae1e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Services/ModelService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ public function setModel($model)
2323

2424
$this->model = $model;
2525

26-
$this->connectionName = $modelInstance->getConnectionName();
26+
$this->connectionName = $modelInstance->getConnectionName() !== null ?
27+
$modelInstance->getConnectionName() : config('database.default');
2728

28-
$this->tableName = $modelInstance->getTable();
29+
$this->tableName = config("database.connections.$this->connectionName.prefix", '').$modelInstance->getTable();
2930

3031
$this->indexName = $modelInstance->searchableAs();
3132

0 commit comments

Comments
 (0)