Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/Resolvers/DomainTenantResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,22 @@
return $tenant;
}

public static function isSubdomain(string $domain): bool
protected function isSubdomain(string $hostname): bool
{
return Str::endsWith($domain, config('tenancy.identification.central_domains'));
$centralDomains = Arr::wrap(config('tenancy.central_domains'));

Check failure on line 61 in src/Resolvers/DomainTenantResolver.php

View workflow job for this annotation

GitHub Actions / Static analysis (PHPStan)

Call to static method wrap() on an unknown class Stancl\Tenancy\Resolvers\Arr.

foreach ($centralDomains as $domain) {

if ($hostname === $domain) {
return false;
}

if (Str::endsWith($hostname, '.' . $domain)) {
return true;
}
}

return false;
}

public function resolved(Tenant $tenant, mixed ...$args): void
Expand Down
Loading