Changeset View
Changeset View
Standalone View
Standalone View
src/app/Package.php
Show All 33 Lines | |||||
class Package extends Model | class Package extends Model | ||||
{ | { | ||||
use BelongsToTenantTrait; | use BelongsToTenantTrait; | ||||
use HasTranslations; | use HasTranslations; | ||||
use UuidStrKeyTrait; | use UuidStrKeyTrait; | ||||
public $timestamps = false; | public $timestamps = false; | ||||
/** @var array<int, string> The attributes that are mass assignable */ | |||||
protected $fillable = [ | protected $fillable = [ | ||||
'description', | 'description', | ||||
'discount_rate', | 'discount_rate', | ||||
'name', | 'name', | ||||
'title', | 'title', | ||||
]; | ]; | ||||
/** @var array Translatable properties */ | /** @var array<int, string> Translatable properties */ | ||||
public $translatable = [ | public $translatable = [ | ||||
'name', | 'name', | ||||
'description', | 'description', | ||||
]; | ]; | ||||
/** | /** | ||||
* The costs of this package at its pre-defined, existing configuration. | * The costs of this package at its pre-defined, existing configuration. | ||||
* | * | ||||
Show All 20 Lines | class Package extends Model | ||||
} | } | ||||
/** | /** | ||||
* Checks whether the package contains a domain SKU. | * Checks whether the package contains a domain SKU. | ||||
*/ | */ | ||||
public function isDomain(): bool | public function isDomain(): bool | ||||
{ | { | ||||
foreach ($this->skus as $sku) { | foreach ($this->skus as $sku) { | ||||
if ($sku->handler_class::entitleableClass() == \App\Domain::class) { | if ($sku->handler_class::entitleableClass() == Domain::class) { | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
/** | /** | ||||
Show All 14 Lines |