Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | public function entitlement() | ||||
return $this->morphOne('App\Entitlement', 'entitleable'); | return $this->morphOne('App\Entitlement', 'entitleable'); | ||||
} | } | ||||
/** | /** | ||||
* Return list of public+active domain names | * Return list of public+active domain names | ||||
*/ | */ | ||||
public static function getPublicDomains(): array | public static function getPublicDomains(): array | ||||
{ | { | ||||
$where = sprintf('(type & %s) AND (status & %s)', Domain::TYPE_PUBLIC, Domain::STATUS_ACTIVE); | $where = sprintf('(type & %s)', Domain::TYPE_PUBLIC); | ||||
return self::whereRaw($where)->get(['namespace'])->map(function ($domain) { | return self::whereRaw($where)->get(['namespace'])->pluck('namespace')->toArray(); | ||||
return $domain->namespace; | |||||
})->toArray(); | |||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is active. | * Returns whether this domain is active. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isActive(): bool | public function isActive(): bool | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |