From a00be22d107aa7241cd75fb3f0e6724b2c38d110 Mon Sep 17 00:00:00 2001 From: Ollie Read Date: Tue, 19 Nov 2024 12:00:17 +0000 Subject: [PATCH] chore: Reset resolver and hook when current tenant is nullified --- src/Support/DefaultTenancy.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Support/DefaultTenancy.php b/src/Support/DefaultTenancy.php index f88b381..c30dd8b 100644 --- a/src/Support/DefaultTenancy.php +++ b/src/Support/DefaultTenancy.php @@ -257,6 +257,11 @@ public function setTenant(?Tenant $tenant): static event(new CurrentTenantChanged($this, $previousTenant, $tenant)); } + if ($tenant === null) { + $this->resolver = null; + $this->hook = null; + } + return $this; }