From 5eaac709765a82a3cc71e3fe2ea19156de630198 Mon Sep 17 00:00:00 2001 From: Moritz Friedrich Date: Tue, 11 Jun 2024 12:26:58 +0200 Subject: [PATCH] Fixed Elasticsearch Factory logger injection --- src/ElasticsearchServiceProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ElasticsearchServiceProvider.php b/src/ElasticsearchServiceProvider.php index 5771ea6..5879bcd 100755 --- a/src/ElasticsearchServiceProvider.php +++ b/src/ElasticsearchServiceProvider.php @@ -203,9 +203,9 @@ protected function registerClientFactory(): void ClientFactory::class ); - $this->app->when(ClientFactoryInterface::class) - ->needs(LoggerInterface::class) - ->give('elasticsearch.logger'); + $this->app->bind(ClientFactory::class, fn(Application $app) => new ClientFactory( + $app->make('elasticsearch.logger') + )); $this->app->alias( ClientFactoryInterface::class,