From cfa9514dfbab9c8bc3d1ea369dbb0e46337ba9de Mon Sep 17 00:00:00 2001 From: antonkomarev Date: Fri, 27 Sep 2019 00:13:25 +0300 Subject: [PATCH] Remove request from tenant manager --- src/Middleware/InitializeTenancy.php | 2 +- src/TenantManager.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Middleware/InitializeTenancy.php b/src/Middleware/InitializeTenancy.php index 4303ab39..3bc383ba 100644 --- a/src/Middleware/InitializeTenancy.php +++ b/src/Middleware/InitializeTenancy.php @@ -29,7 +29,7 @@ class InitializeTenancy public function handle($request, Closure $next) { try { - tenancy()->init(); + tenancy()->init($request->getHost()); } catch (TenantCouldNotBeIdentifiedException $e) { ($this->onFail)($e); } diff --git a/src/TenantManager.php b/src/TenantManager.php index 669c6468..82ae0e57 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -133,9 +133,8 @@ class TenantManager * @param string $domain * @return self */ - public function init(string $domain = null): self + public function init(string $domain): self { - $domain = $domain ?? request()->getHost(); $this->initializeTenancy($this->findByDomain($domain)); return $this;