Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Lines | class User extends Authenticatable implements JWTSubject | ||||
} | } | ||||
public function getJWTCustomClaims() | public function getJWTCustomClaims() | ||||
{ | { | ||||
return []; | return []; | ||||
} | } | ||||
/** | /** | ||||
* Check if user has an entitlement for the specified SKU. | |||||
* | |||||
* @param string $title The SKU title | |||||
* | |||||
* @return bool True if specified SKU entitlement exists | |||||
*/ | |||||
public function hasSku($title): bool | |||||
{ | |||||
$sku = Sku::where('title', $title)->first(); | |||||
if (!$sku) { | |||||
return false; | |||||
} | |||||
return $this->entitlements()->where('sku_id', $sku->id)->count() > 0; | |||||
} | |||||
/** | |||||
* Returns whether this domain is active. | * Returns whether this domain is active. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isActive(): bool | public function isActive(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_ACTIVE) > 0; | return ($this->status & self::STATUS_ACTIVE) > 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 264 Lines • Show Last 20 Lines |