From 6ad1a6639f674e6b0c5808d3990319a0f41adc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 19 Jan 2020 12:08:16 +0100 Subject: [PATCH] Set $persisted in TenantManager::createTenant() (#272) * Set $persisted in TenantManager::createTenant() * Apply fixes from StyleCI --- src/Commands/Install.php | 2 +- src/Tenant.php | 4 +--- src/TenantManager.php | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Commands/Install.php b/src/Commands/Install.php index c1012d94..426bf1d3 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -33,7 +33,7 @@ class Install extends Command $this->callSilent('vendor:publish', [ '--provider' => 'Stancl\Tenancy\TenancyServiceProvider', '--tag' => 'config', - ]); + ]); $this->info('✔️ Created config/tenancy.php'); $newKernel = str_replace( diff --git a/src/Tenant.php b/src/Tenant.php index 8e6a900b..38ac7261 100644 --- a/src/Tenant.php +++ b/src/Tenant.php @@ -41,7 +41,7 @@ class Tenant implements ArrayAccess /** @var Repository */ protected $config; - /** @var StorageDriver */ + /** @var StorageDriver|CanDeleteKeys */ protected $storage; /** @var TenantManager */ @@ -233,8 +233,6 @@ class Tenant implements ArrayAccess $this->manager->createTenant($this); } - $this->persisted = true; - return $this; } diff --git a/src/TenantManager.php b/src/TenantManager.php index 9e3b20ea..2128da5a 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -73,6 +73,8 @@ class TenantManager $this->storage->createTenant($tenant); + $tenant->persisted = true; + /** @var \Illuminate\Contracts\Queue\ShouldQueue[]|callable[] $afterCreating */ $afterCreating = [];