Skip to content

Commit

Permalink
Only bind UUID generator if one is specified in config (archtechx#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
domkrm authored Sep 16, 2020
1 parent 5fe79fe commit 218a34c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TenancyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public function register(): void
}

// 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']);
Expand Down

0 comments on commit 218a34c

Please sign in to comment.