Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | class Domain extends Model | ||||
* @return \Illuminate\Database\Eloquent\Relations\MorphOne | * @return \Illuminate\Database\Eloquent\Relations\MorphOne | ||||
*/ | */ | ||||
public function entitlement() | 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 (for current tenant) | ||||
*/ | */ | ||||
public static function getPublicDomains(): array | public static function getPublicDomains(): array | ||||
{ | { | ||||
$where = sprintf('(type & %s)', Domain::TYPE_PUBLIC); | return self::withEnvTenant() | ||||
->whereRaw(sprintf('(type & %s)', Domain::TYPE_PUBLIC)) | |||||
return self::whereRaw($where)->get(['namespace'])->pluck('namespace')->toArray(); | ->get(['namespace'])->pluck('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 326 Lines • Show Last 20 Lines |