Addon
Service addons
Please note that "Service Addons" are completely separate from "WHMCS Addons," which add functionality to WHMCS.
A service Addon allows the operator of WHMCS to provide additional services which are conditional to the purchase of a parent Service, such as additional disk space or other similar services.
This object is an instance of a service addon, including the fees and cycles configured in the Order which purchased this addon.
Traits
Properties summary
Type | Property | Description | |
---|---|---|---|
protected | $table | ||
protected | $columnMap | ||
protected | $dates | ||
protected | $appends | ||
int | $id | Unique ID number for this addon instance. | |
int | $orderId | ID of order in which this addon was purchased. | |
int | $serviceId | ID of service which this addon is attached to. | |
int | $addonId | ID of addon that this object is an instance of. | |
int | $clientId | Id of client that this addon is on | |
int | $serverId | Id of server that this addon is on | |
string | $name | Name of this addon. This will either be the name assigned to the master addon, or a custom name assigned by an admin. | |
float | $setupFee | Setup fee paid for this addon. | |
float | $recurringFee | Recurring fee scheduled for this addon. | |
string | $billingCycle | English language internal name for billing cycle from this set: 'Free Account', 'One Time', 'Monthly', 'Quarterly', 'Semi-Annually', 'Annually', 'Biennially', 'Triennially' | |
int | $qty | ||
string | $applyTax | True if tax is charged when purchasing/paying for this addon. | |
string | $status | English language internal name of status of this service, from this set: 'Pending', 'Active', 'Suspended', 'Terminated', 'Cancelled', 'Fraud' (Additionally custom status may exist) | |
Carbon | $registrationDate | Date when this addon was purchased. | |
Carbon | $nextDueDate | The next date this addon's billing cycle is due. | |
Carbon | $nextInvoiceDate | The date the next invoice will be generated for this addon. | |
Carbon | $terminationDate | The date the addon was Terminated or Cancelled. | |
string | $paymentGateway | English language internal name for the gateway used to originally purchase this service. | |
string | $notes | Admin provided notes on this addon that should not be displayed to clients. | |
string | $subscriptionId | ||
Carbon | $createdAt | The date this addon was created. | |
Carbon | $updatedAt | The date this addon was last updated. | |
Properties | $serviceProperties | ||
Carbon|string | $nextDueDateFormatted | Client formatted display for next Due Date | |
Carbon|string | $registrationDateFormatted | Client formatted display for Registration Date | |
array | $nextDueDateProperties | An array of Next Due Date values used within the template. isPast, isFuture, and daysTillExpiry. | |
Service | $service | ||
Addon | $productAddon | ||
Client | $client | Client object which owns this service. | |
Collection|CustomFieldValue[] | $customFieldValues | ||
Order | $order | ||
Server | $serverModel | ||
Collection|Queue[] | $failedActions | Any failed actions related to this addon. |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
static | boot() | - | |
Builder | scopeUserId(Builder $query, int $userId) | - | |
Builder | scopeOfService(Builder $query, integer $serviceId) | - | |
Builder | scopeActive(Builder $query) | - | |
Builder | scopeMarketConnect(Builder $query) | Filter for only MarketConnect addon services. | |
Builder | scopeIsConsideredActive(Builder $query) | - | |
Builder | scopeIsNotRecurring(Builder $query) | - | |
BelongsTo | service() | Each addon belongs to one service. | |
BelongsTo | productAddon() | Each addon belongs to a single product addon. | |
BelongsTo | client() | Each addon belongs to one client. | |
HasMany|CustomFieldValue | customFieldValues() | - | |
getCustomFieldType() | - | ||
getCustomFieldRelId() | - | ||
BelongsTo | order() | An addon belongs to a single order. | |
HasMany | paymentGateway() | Each addon has many payment gateway records. | |
Properties | getServicePropertiesAttribute() | - | |
HasMany | ssl() | Each addon could have many ssl records. | |
bool | canBeUpgraded() | Determine if addon can be upgraded. | |
bool | isService() | Is this entity a service? | |
bool | isAddon() | Is this entity an addon? | |
HasOne | serverModel() | - | |
HasMany | failedActions() | - | |
string | legacyProvision() | Run provision action in legacy mode. | |
bool | isRecurring() | - | |
getLink() | - | ||
float | recalculateRecurringPrice() | - |
Details
static
boot ()
Builder
scopeUserId (Builder $query, int $userId)
Builder
scopeOfService (Builder $query, integer $serviceId)
Builder
scopeActive (Builder $query)
Builder
scopeMarketConnect (Builder $query)
Filter for only MarketConnect addon services.
Builder
scopeIsConsideredActive (Builder $query)
Builder
scopeIsNotRecurring (Builder $query)
BelongsTo
service ()
Each addon belongs to one service.
BelongsTo
productAddon ()
Each addon belongs to a single product addon.
BelongsTo
client ()
Each addon belongs to one client.
HasMany|CustomFieldValue
customFieldValues ()
protected
getCustomFieldType ()
protected
getCustomFieldRelId ()
BelongsTo
order ()
An addon belongs to a single order.
HasMany
paymentGateway ()
Each addon has many payment gateway records.
Properties
getServicePropertiesAttribute ()
HasMany
ssl ()
Each addon could have many ssl records.
bool
canBeUpgraded ()
Determine if addon can be upgraded.
bool
isService ()
Is this entity a service?
bool
isAddon ()
Is this entity an addon?
HasOne
serverModel ()
HasMany
failedActions ()
string
legacyProvision ()
Run provision action in legacy mode.
Legacy mode returns 'success' on success and an error message string on failure.