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;