Changeset View
Changeset View
Standalone View
Standalone View
src/app/Entitlement.php
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | public function createTransaction($type, $amount = null) | ||||
'amount' => $amount | 'amount' => $amount | ||||
] | ] | ||||
); | ); | ||||
return $transaction->id; | return $transaction->id; | ||||
} | } | ||||
/** | /** | ||||
* Principally entitleable objects such as 'Domain' or 'User'. | * Principally entitleable object such as Domain, User, Group. | ||||
* Note that it may be trashed (soft-deleted). | |||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function entitleable() | public function entitleable() | ||||
{ | { | ||||
return $this->morphTo(); | return $this->morphTo()->withTrashed(); // @phpstan-ignore-line | ||||
} | } | ||||
/** | /** | ||||
* Returns entitleable object title (e.g. email or domain name). | * Returns entitleable object title (e.g. email or domain name). | ||||
* | * | ||||
* @return string|null An object title/name | * @return string|null An object title/name | ||||
*/ | */ | ||||
public function entitleableTitle(): ?string | public function entitleableTitle(): ?string | ||||
Show All 36 Lines |