From 218a34c40ed5e0b2f087616e6946dd2ce5e79304 Mon Sep 17 00:00:00 2001 From: domkrm Date: Wed, 16 Sep 2020 15:06:24 +0200 Subject: [PATCH] Only bind UUID generator if one is specified in config (#493) --- src/TenancyServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TenancyServiceProvider.php b/src/TenancyServiceProvider.php index 58ae70f2..946f114f 100644 --- a/src/TenancyServiceProvider.php +++ b/src/TenancyServiceProvider.php @@ -54,7 +54,9 @@ class TenancyServiceProvider extends ServiceProvider } // Bind the class in the tenancy.id_generator config to the UniqueIdentifierGenerator abstract. - $this->app->bind(Contracts\UniqueIdentifierGenerator::class, $this->app['config']['tenancy.id_generator']); + if (! is_null($this->app['config']['tenancy.id_generator'])) { + $this->app->bind(Contracts\UniqueIdentifierGenerator::class, $this->app['config']['tenancy.id_generator']); + } $this->app->singleton(Commands\Migrate::class, function ($app) { return new Commands\Migrate($app['migrator'], $app['events']);