From eeb5004e1293e3512d7729f68855a955be89f6b7 Mon Sep 17 00:00:00 2001 From: mpyw Date: Thu, 12 Mar 2020 17:19:52 +0900 Subject: [PATCH] Fix: Prevent ServiceProvider from overwriting bindings (#18) --- src/StickinessServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StickinessServiceProvider.php b/src/StickinessServiceProvider.php index e9fa94e..3547c3a 100644 --- a/src/StickinessServiceProvider.php +++ b/src/StickinessServiceProvider.php @@ -42,7 +42,7 @@ public function register(): void $this->app->singleton(StickinessEventListener::class); $this->app->singleton('db.factory', ConnectionFactory::class); - $this->app->bind(StickinessResolverInterface::class, IpBasedResolver::class); - $this->app->bind(JobInitializerInterface::class, AlwaysModifiedInitializer::class); + $this->app->bindIf(StickinessResolverInterface::class, IpBasedResolver::class); + $this->app->bindIf(JobInitializerInterface::class, AlwaysModifiedInitializer::class); } }