Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit 13a8247

Browse files
Typesense client configuration.
- Fixed passing configuration to Typesense client.
1 parent 55efffa commit 13a8247

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/TypesenseServiceProvider.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ class TypesenseServiceProvider extends ServiceProvider
2121
public function boot(): void
2222
{
2323
$this->app[EngineManager::class]->extend('typesensesearch', static function ($app) {
24-
$client = new Client([
25-
'master_node' => config('scout.typesensesearch.master_node', []),
26-
'read_replica_nodes' => !config('scout.typesensesearch.enabled_read_replica', false) ? [] : config('scout.typesensesearch.read_replicas', []),
27-
'timeout_seconds' => config('scout.typesensesearch.timeout', 2.0),
28-
]);
24+
$client = new Client(config('scout.typesensesearch'));
2925
return new TypesenseSearchEngine(new Typesense($client));
3026
});
3127

@@ -39,16 +35,11 @@ public function boot(): void
3935
public function register(): void
4036
{
4137
$this->app->singleton(Typesense::class, static function () {
42-
$client = new Client([
43-
'master_node' => config('scout.typesensesearch.master_node', []),
44-
'read_replica_nodes' => !config('scout.typesensesearch.enabled_read_replica', false) ? [] : config('scout.typesensesearch.read_replicas', []),
45-
'timeout_seconds' => config('scout.typesensesearch.timeout', 2.0),
46-
]);
47-
38+
$client = new Client(config('scout.typesensesearch'));
4839
return new Typesense($client);
4940
});
5041

5142
$this->app->alias(Typesense::class, 'typesense');
5243
}
5344

54-
}
45+
}

0 commit comments

Comments
 (0)