Changeset View
Changeset View
Standalone View
Standalone View
src/app/Handlers/Base.php
Show All 13 Lines | public static function entitleableClass(): string | ||||
return ''; | return ''; | ||||
} | } | ||||
/** | /** | ||||
* Check if the SKU is available to the user. An SKU is available | * Check if the SKU is available to the user. An SKU is available | ||||
* to the user/domain when either it is active or there's already an | * to the user/domain when either it is active or there's already an | ||||
* active entitlement. | * active entitlement. | ||||
* | * | ||||
* @param \App\Sku $sku The SKU object | * @param \App\Sku $sku The SKU | ||||
* @param \App\User|\App\Domain $object The user or domain object | * @param object $object The entitleable object | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public static function isAvailable(\App\Sku $sku, $object): bool | public static function isAvailable(\App\Sku $sku, $object): bool | ||||
{ | { | ||||
if (!$sku->active) { | if (!$sku->active) { | ||||
if (!$object->entitlements()->where('sku_id', $sku->id)->first()) { | if (!$object->entitlements()->where('sku_id', $sku->id)->first()) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |