Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | class User extends Authenticatable implements JWTSubject | ||||
* | * | ||||
* @return Domain[] List of Domain objects | * @return Domain[] List of Domain objects | ||||
*/ | */ | ||||
public function domains(): array | public function domains(): array | ||||
{ | { | ||||
if ($this->tenant_id) { | if ($this->tenant_id) { | ||||
$domains = Domain::where('tenant_id', $this->tenant_id); | $domains = Domain::where('tenant_id', $this->tenant_id); | ||||
} else { | } else { | ||||
$domains = Domain::withEnvTenant(); | $domains = Domain::withEnvTenantContext(); | ||||
} | } | ||||
$domains = $domains->whereRaw(sprintf('(type & %s)', Domain::TYPE_PUBLIC)) | $domains = $domains->whereRaw(sprintf('(type & %s)', Domain::TYPE_PUBLIC)) | ||||
->whereRaw(sprintf('(status & %s)', Domain::STATUS_ACTIVE)) | ->whereRaw(sprintf('(status & %s)', Domain::STATUS_ACTIVE)) | ||||
->get() | ->get() | ||||
->all(); | ->all(); | ||||
foreach ($this->wallets as $wallet) { | foreach ($this->wallets as $wallet) { | ||||
▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines |