Skip to content

Commit 03228bd

Browse files
committed
fix: make connection nullable
1 parent e86a06a commit 03228bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/IndexedRecord.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ class IndexedRecord extends Model
1919
*/
2020
public function __construct(array $attributes = [])
2121
{
22-
$this->connection = Config::string('laravel-fulltext.db_connection');
22+
$connection = Config::get('laravel-fulltext.db_connection');
23+
24+
if (!is_string($connection)) {
25+
$connection = null;
26+
}
27+
28+
$this->connection = $connection;
2329

2430
parent::__construct($attributes);
2531
}

0 commit comments

Comments
 (0)