Skip to content

Commit

Permalink
fix: make connection nullable
Browse files Browse the repository at this point in the history
Rocksheep committed Nov 15, 2024

Verified

This commit was signed with the committer’s verified signature.
1 parent e86a06a commit 03228bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/IndexedRecord.php
Original file line number Diff line number Diff line change
@@ -19,7 +19,13 @@ class IndexedRecord extends Model
*/
public function __construct(array $attributes = [])
{
$this->connection = Config::string('laravel-fulltext.db_connection');
$connection = Config::get('laravel-fulltext.db_connection');

if (!is_string($connection)) {
$connection = null;
}

$this->connection = $connection;

parent::__construct($attributes);
}

0 comments on commit 03228bd

Please sign in to comment.