In the ClientAreaDomainDetailsOutput WHMCS hook, the structure of data available in the function is this:
array (
'domain' => WHMCS\Domain\Domain::__set_state(array(
'table' => 'tbldomains',
'dates' => array (
0 => 'registrationdate',
1 => 'expirydate',
2 => 'nextduedate',
3 => 'nextinvoicedate',
),
'columnMap' => array (
'clientId' => 'userid',
'registrarModuleName' => 'registrar',
'promotionId' => 'promoid',
'paymentGateway' => 'paymentmethod',
'hasDnsManagement' => 'dnsmanagement',
'hasEmailForwarding' => 'emailforwarding',
'hasIdProtection' => 'idprotection',
'hasAutoInvoiceOnNextDueDisabled' => 'donotrenew',
'isSyncedWithRegistrar' => 'synced',
'isPremium' => 'is_premium',
),
'booleans' => array (
0 => 'hasDnsManagement',
1 => 'hasEmailForwarding',
2 => 'hasIdProtection',
3 => 'isPremium',
4 => 'hasAutoInvoiceOnNextDueDisabled',
5 => 'isSyncedWithRegistrar',
),
'characterSeparated' => array (
'|' => array (
0 => 'reminders',
),
),
'appends' => array (
0 => 'tld',
1 => 'domainPunycode',
2 => 'extension',
3 => 'gracePeriod',
4 => 'gracePeriodFee',
5 => 'redemptionGracePeriod',
6 => 'redemptionGracePeriodFee',
),
'unique' => array ( ),
'guardedForUpdate' => array ( ),
'strings' => array ( ),
'ints' => array ( ),
'fillable' => array ( ),
'semanticVersions' => array ( ),
'commaSeparated' => array ( ),
'rules' => array ( ),
'errors' => NULL,
'customValidationMessages' => array ( ),
'connection' => 'default',
'primaryKey' => 'id',
'keyType' => 'int',
'incrementing' => true,
'with' => array ( ),
'withCount' => array ( ),
'perPage' => 15,
'exists' => true,
'wasRecentlyCreated' => false,
'attributes' => array (
'id' => 2,
'userid' => 1,
'orderid' => 5,
'type' => 'Register',
'registrationdate' => '2022-09-13',
'domain' => 'example.com',
'firstpaymentamount' => '90.00',
'recurringamount' => '90.00',
'registrar' => 'DomainRegister',
'registrationperiod' => 1,
'expirydate' => '2025-08-05',
'subscriptionid' => '',
'promoid' => 0,
'status' => 'Active',
'nextduedate' => '2022-09-13',
'nextinvoicedate' => '2022-09-13',
'additionalnotes' => '',
'paymentmethod' => 'mailin',
'dnsmanagement' => 0,
'emailforwarding' => 0,
'idprotection' => 0,
'is_premium' => 0,
'donotrenew' => 0,
'reminders' => '',
'synced' => 1,
'created_at' => '0000-00-00 00:00:00',
'updated_at' => '0000-00-00 00:00:00',
),
'original' => array (
'id' => 2,
'userid' => 1,
'orderid' => 5,
'type' => 'Register',
'registrationdate' => '2022-09-13',
'domain' => 'example.com',
'firstpaymentamount' => '90.00',
'recurringamount' => '90.00',
'registrar' => 'DomainRegister',
'registrationperiod' => 1,
'expirydate' => '2025-08-05',
'subscriptionid' => '',
'promoid' => 0,
'status' => 'Active',
'nextduedate' => '2022-09-13',
'nextinvoicedate' => '2022-09-13',
'additionalnotes' => '',
'paymentmethod' => 'mailin',
'dnsmanagement' => 0,
'emailforwarding' => 0,
'idprotection' => 0,
'is_premium' => 0,
'donotrenew' => 0,
'reminders' => '',
'synced' => 1,
'created_at' => '0000-00-00 00:00:00',
'updated_at' => '0000-00-00 00:00:00',
),
'changes' => array ( ),
'casts' => array ( ),
'classCastCache' => array ( ),
'dateFormat' => NULL,
'dispatchesEvents' => array ( ),
'observables' => array ( ),
'relations' => array ( ),
'touches' => array ( ),
'timestamps' => true,
'hidden' => array ( ),
'visible' => array ( ),
'guarded' => array (
0 => '*',
),
)),
)
So i.e. following variables are defined:
$domainName = $domain->domain;
$clientModel = $domain->client;
$domainStatus = $domain->status;
$domainNextDueDate = $domain -> nextduedate;
$domainExpiryDate = $domain -> expirydate;
$domainDoNotRenew = $domain -> donotrenew;
$domainRegistrar = $domain -> registrar;
$clientName = $clientModel->firstName . ' ' . $clientModel->lastName;