Class · extends AbstractModel · implements InvoicingServiceInterface, SubscriptionAwareInterface
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.
DomainTraitsSubscriptionAwareTrait
public function scopeOfClient(Builder $query, $clientId)Retrieve domains for a specific user
Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query | |
integer | $clientId |
Returns Builder
public function scopeNextDueBefore(Builder $query, Carbon $date)Retrieve domains due before a given date.
Parameters
| Type | Name | Description |
|---|---|---|
\Illuminate\Database\Eloquent\Builder | $query | |
Carbon | $date |
Returns \Illuminate\Database\Eloquent\Builder
public function scopeIsConsideredActive(Builder $query)Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function scopeFree(Builder $query)Ensure the recurring amount is 0.00.
Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function scopeNotFree(Builder $query)Ensure the recurring amount is not 0.00.
Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function getTldAttribute()Get domain tld extension.
Returns string
public static function getNonTerminalStatuses(): arrayStatus values representative of an entry that has further status values it could transition to.
Returns string[] — Array of Statuses as strings
public function client()Each domain belongs to one client.
Returns \Illuminate\Database\Eloquent\Relations\BelongsTo
public function additionalFields()Every domain can have one or more additional registrar-specific fields.
Returns \Illuminate\Database\Eloquent\Relations\HasMany
public function extra()Every domain may have extra information fields
Returns HasMany
public function order()A domain belongs to a single order.
Returns BelongsTo
public function paymentGateway()Each domain has many payment gateway records.
Returns \Illuminate\Database\Eloquent\Relations\HasMany
public function invoiceItems()A domain can have many invoice items
Returns hasMany
public function invoices(): BelongsToManypublic function getRegistrarInterface()Get domain registrar module interface.
Returns \WHMCS\Module\Registrar
public function getDomainObject()Get domain object.
Returns \WHMCS\Domains\Domain
public function setRemindersAttribute(string $reminderString)Enforce business logic around domain reminders.
Parameters
| Type | Name | Description |
|---|---|---|
string | $reminders |
public function failedActions()Returns HasMany
public function isConfiguredTld()Returns true if tld is configured for sale.
Returns bool
public function getAdditionalFields()Get additional fields for the current domain.
Returns AdditionalFields
public function getExtensionAttribute()Returns \Illuminate\Database\Eloquent\Model\|null\|static\|Extension
public function getGracePeriodAttribute()Returns int
public function getGracePeriodFeeAttribute()Returns float
public function getRedemptionGracePeriodAttribute()Returns int
public function getRedemptionGracePeriodFeeAttribute()Returns float
public function getLink()public function getBestNameserversForNewOrder()Get best nameservers for new domain order.
Uses the following, in order:
- Matching service domain record
- Nameservers specified in order
- System default values
Returns string[]
public function getTranslatedStatusAttribute(): ?stringGet the translated domain status
Returns string — Returns translated domain status or internal status if translation is not available
public function scopeDueForSync(Builder $query)Retrieve domain names due for Domain Synchronisation
Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function isFree(): boolReturns bool
public function recalculateRecurringPrice(): selfpublic function getRegistrarModuleDisplayName(string $stringForNone): stringRetrieve the display name of the Registrar Module associated with this Domain.
> In the instance of no module being set, the $stringForNone default value will be returned. > In the instance of a missing module, no Display name can be retrieved. The module > as specified in the database will be returned as-is.
Parameters
| Type | Name | Description |
|---|---|---|
string | $stringForNone | The string to return if the no Registrar Module has been specified. |
Returns string
public function getInvoicingServiceItemType(): stringpublic function getInvoicingServiceFirstPaymentAmount(): Pricepublic function getInvoicingServiceRecurringAmount(): Price