Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 393 Lines • ▼ Show 20 Lines | class Domain extends Model | ||||
/** | /** | ||||
* Returns the wallet by which the domain is controlled | * Returns the wallet by which the domain is controlled | ||||
* | * | ||||
* @return \App\Wallet A wallet object | * @return \App\Wallet A wallet object | ||||
*/ | */ | ||||
public function wallet(): ?Wallet | public function wallet(): ?Wallet | ||||
{ | { | ||||
// Note: Not all domains have a entitlement/wallet | // Note: Not all domains have a entitlement/wallet | ||||
$entitlement = $this->entitlement()->first(); | $entitlement = $this->entitlement()->withTrashed()->first(); | ||||
return $entitlement ? $entitlement->wallet : null; | return $entitlement ? $entitlement->wallet : null; | ||||
} | } | ||||
} | } |