A customer's domain.

Customers are allowed to register and transfer domain names using WHMCS. These domain names are then associated with their Client record and any Services they purchased with the Domain name.

Note that the "subscriptionid" field was originally intended to store the PayPal Subscription ID for a domain when one was first created, and then used to track and associate future payments of that subscription ID. However, later the logic was changed and so now PayPal subscription matching is done based only invoice or service relationships. Nonetheless, this field is still exposed via the admin interface and can be set and used manually by admin users.

class Domain extends AbstractModel

Properties summary

Type Property Description
protected $table
protected $dates
protected $columnMap
protected $booleans
protected $characterSeparated
protected $appends
int $id Unique ID for this domain object.
int $clientId ID of client who owns this domain.
int $orderId ID of order where this domain was purchased.
string $type English language internal name of the type of registration used for this domain from this set: 'Register' and 'Transfer'
Carbon $registrationDate Date this domain was registered.
string $domain This domain name.
string $tld The top level domain (extension).
float $firstPaymentAmount Initial payment made to purchase this domain.
float $recurringAmount Recurring payment amount assigned to this domain name purchase.
string $registrarModuleName Internal name of registrar module used to register this domain.
int $registrationPeriod Purchased registration period, in years.
Carbon $expiryDate Date the registration expires
string $subscriptionId See note above about the subscriptionId field
int $promotionId ID of promotion used to purchase this domain.
string $status English language internal name of the status of this domain registration from this set: 'Pending', 'Pending Registration', 'Pending Transfer', 'Active', 'Grace', 'Redemption', 'Expired', 'Cancelled', 'Fraud', 'Transferred Away'
Carbon $nextDueDate The date the next payment is due on.
Carbon $nextInvoiceDate The date the next invoice will be generated on.
string $additionalNotes Additional notes provided by the admin. Should not be displayed to the client.
string $paymentGateway Internal name of payment gateway used to purchase this domain name.
bool $hasDnsManagement True if the customer purchased DNS management as part of this domain purchase.
bool $hasEmailForwarding True if customer purchased Email Forwarding as part of this domain purchase.
bool $hasIdProtection True if customer purchased ID Protection (anonymous WHOIS) as part of this domain purchase.
bool $isPremium True if the domain is considered premium at registry.
bool $hasAutoInvoiceOnNextDueDisabled True if "Disable Auto Renew" is activated for this domain.
string $reminders Pipe delimited string of Email IDs.
bool $isSyncedWithRegistrar True if the registrar's data on this domain is fully synced with WHMCS.
Extension|null $extension The record from tbldomainpricing for this domain.
integer $gracePeriod
float $gracePeriodFee
integer $redemptionGracePeriod
float $redemptionGracePeriodFee
Carbon $createdAt Date this domain was created.
Carbon $updatedAt Date this domain was last edited.
Client $client Client to whom this domain belongs to.
Collection|AdditionalField[] $additionalFields All additional fields belonging to this domain's registration.
Collection|Extra[] $extra All extra fields belonging to this domain registration.
Collection|Queue[] $failedActions Any failed actions related to this domain.
Order $order
Collection|Item[] $invoiceItems[] Any invoice items related to this domain

Methods summary

Return Type Method Name Description
Builder scopeOfClient(Builder $query, integer $clientId) Retrieve domains for a specific user
Builder scopeNextDueBefore(Builder $query, Carbon $date) Retrieve domains due before a given date.
Builder scopeIsConsideredActive(Builder $query) -
string getTldAttribute() Get domain tld extension.
BelongsTo client() Each domain belongs to one client.
HasMany additionalFields() Every domain can have one or more additional registrar-specific fields.
HasMany extra() Every domain may have extra information fields
BelongsTo order() A domain belongs to a single order.
HasMany paymentGateway() Each domain has many payment gateway records.
hasMany invoiceItems() A domain can have many invoice items
setRemindersAttribute(string $reminders) Enforce business logic around domain reminders.
HasMany failedActions() -
bool isConfiguredTld() Returns true if tld is configured for sale.
AdditionalFields getAdditionalFields() Get additional fields for the current domain.
Model|null|Domain|Extension getExtensionAttribute() -
int getGracePeriodAttribute() -
float getGracePeriodFeeAttribute() -
int getRedemptionGracePeriodAttribute() -
float getRedemptionGracePeriodFeeAttribute() -
getLink() -

Details

Builder scopeOfClient (Builder $query, integer $clientId)

Retrieve domains for a specific user

Parameters

Builder $query
integer $clientId

Return Value

Builder

Builder scopeNextDueBefore (Builder $query, Carbon $date)

Retrieve domains due before a given date.

Parameters

Builder $query
Carbon $date

Return Value

Builder

Builder scopeIsConsideredActive (Builder $query)

Parameters

Builder $query

Return Value

Builder

string getTldAttribute ()

Get domain tld extension.

Return Value

string

BelongsTo client ()

Each domain belongs to one client.

Return Value

BelongsTo

HasMany additionalFields ()

Every domain can have one or more additional registrar-specific fields.

Return Value

HasMany

HasMany extra ()

Every domain may have extra information fields

Return Value

HasMany

BelongsTo order ()

A domain belongs to a single order.

Return Value

BelongsTo

HasMany paymentGateway ()

Each domain has many payment gateway records.

Return Value

HasMany

hasMany invoiceItems ()

A domain can have many invoice items

Return Value

hasMany

setRemindersAttribute (string $reminders)

Enforce business logic around domain reminders.

Parameters

string $reminders

Exceptions

Exception when an invalid reminder value is set.

HasMany failedActions ()

Return Value

HasMany

bool isConfiguredTld ()

Returns true if tld is configured for sale.

Return Value

bool

AdditionalFields getAdditionalFields ()

Get additional fields for the current domain.

Return Value

AdditionalFields

Model|null|Domain|Extension getExtensionAttribute ()

Return Value

Model|null|Domain|Extension

int getGracePeriodAttribute ()

Return Value

int

float getGracePeriodFeeAttribute ()

Return Value

float

int getRedemptionGracePeriodAttribute ()

Return Value

int

float getRedemptionGracePeriodFeeAttribute ()

Return Value

float