Contact
A client contact
Client users may have more than one set of contact information on their account. WHMCS uses this contact information when sending messages from specific systems. For instance, a client contact can be configured as a domain contact, and WHMCS will send all domain related email to the contact instead of the client. The contact object models this extra client contact information.
Client contacts may optionally be configured as sub-accounts. Sub-accounts can log into the WHMCS client area and interact with the client's record and services, given the proper permissions set by the client.
Traits
Properties summary
Type | Property | Description | |
---|---|---|---|
protected | $table | ||
protected | $columnMap | ||
protected | $dates | ||
protected | $booleans | ||
protected | $commaSeparated | ||
protected | $appends | ||
static | $allPermissions | All contact permissions. | |
$hidden | |||
int | $id | Unique A clients contact's unique id. | |
int | $clientId | The id of the client a client contact belongs to. | |
string | $firstName | A client contact's first name. | |
string | $lastName | A client contact's last name. | |
string | $companyName | The name of the company employing a client contact. | |
string | A client contact's email address. | ||
string | $address1 | The first line of the address a client contact resides at. | |
string | $address2 | The second line of the address a client contact resides at. | |
string | $city | The city a client contact resides in. | |
string | $state | The state or province a client contact resides in. | |
string | $postcode | The post or zip code a client contact resides in. | |
string | $country | The two-letter ISO code of the country a client contact resides in. | |
string | $phoneNumber | A client contact's phone number. | |
string | $taxId | A client contact's tax id. | |
bool | $isSubAccount | Whether or not a client contact is a sub-account. Sub-accounts may log into the client area. | |
string | $passwordHash | A client contact's stored password hash. | |
string[] | $permissions | The permissions associated with a client contact. | |
bool | $receivesDomainEmails | Whether or not a client contact receives domain related emails. | |
bool | $receivesGeneralEmails | Whether or not a client contact receives unrelated to specific systems. | |
bool | $receivesInvoiceEmails | Whether or not a client contact receives invoice related emails. | |
bool | $receivesProductEmails | Whether or not a client contact receives product related emails. | |
bool | $receivesSupportEmails | Whether or not a client contact receives support related emails. | |
bool | $receivesAffiliateEmails | Whether or not a client contact receives emails from the client affiliate system. | |
string | $passwordResetKey | The auto-generated key from a client contact's last password reset attempt. | |
Carbon | $passwordResetKeyExpiryDate | The date that a client contact's most recent password reset key will expire. | |
Carbon | $createdAt | The date a client contact was created. | |
Carbon | $updatedAt | The date a client contact was last updated. | |
string | $fullName | A client contact's first name and last name. | |
string | $countryName | The full name of the country a client contact resides in. | |
Client | $client | The client that a client contact belongs to. | |
Collection|AccountLink[] | $remoteAccountLinks | ||
Collection|Order[] | $orders | ||
Collection|Ticket[] | $tickets |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
BelongsTo | client() | Each contact belongs to one client. | |
HasMany | remoteAccountLinks() | A client can have many linked remote accounts. | |
HasMany | orders() | An addon can have many orders. | |
string | getFullNameAttribute() | "FullName" is the concatenation of first and last name. | |
string | getCountryNameAttribute() | Returns the human readable name for the contacts country. | |
updateLastLogin(Carbon $time = null, $ip = null, $host = null) | - | ||
getLanguageAttribute() | - | ||
getTwoFactorAuthModuleAttribute() | - | ||
HasMany | tickets() | A contact can have many tickets. | |
static bool | currentContactHasPermissionName($permissionName) | Determine if the logged-in Contact has the specified permission |
Details
BelongsTo
client ()
Each contact belongs to one client.
HasMany
remoteAccountLinks ()
A client can have many linked remote accounts.
HasMany
orders ()
An addon can have many orders.
string
getFullNameAttribute ()
"FullName" is the concatenation of first and last name.
In classic WHMCS objects, we compute a field named "name" which combines the first and last name for convenience in templates.
string
getCountryNameAttribute ()
Returns the human readable name for the contacts country.
updateLastLogin (Carbon $time = null, $ip = null, $host = null)
getLanguageAttribute ()
getTwoFactorAuthModuleAttribute ()
HasMany
tickets ()
A contact can have many tickets.
static bool
currentContactHasPermissionName ($permissionName)
Determine if the logged-in Contact has the specified permission