1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 15:54:03 +00:00

Remove request from tenant manager

This commit is contained in:
antonkomarev 2019-09-27 00:13:25 +03:00
parent cacf239801
commit cfa9514dfb
2 changed files with 2 additions and 3 deletions

View file

@ -29,7 +29,7 @@ class InitializeTenancy
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
try { try {
tenancy()->init(); tenancy()->init($request->getHost());
} catch (TenantCouldNotBeIdentifiedException $e) { } catch (TenantCouldNotBeIdentifiedException $e) {
($this->onFail)($e); ($this->onFail)($e);
} }

View file

@ -133,9 +133,8 @@ class TenantManager
* @param string $domain * @param string $domain
* @return self * @return self
*/ */
public function init(string $domain = null): self public function init(string $domain): self
{ {
$domain = $domain ?? request()->getHost();
$this->initializeTenancy($this->findByDomain($domain)); $this->initializeTenancy($this->findByDomain($domain));
return $this; return $this;