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.

class Addon extends AbstractModel

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'
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
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() -

Details

static boot ()

Builder scopeUserId (Builder $query, int $userId)

Parameters

Builder $query
int $userId

Return Value

Builder

Builder scopeOfService (Builder $query, integer $serviceId)

Parameters

Builder $query
integer $serviceId

Return Value

Builder

Builder scopeActive (Builder $query)

Parameters

Builder $query

Return Value

Builder

Builder scopeMarketConnect (Builder $query)

Filter for only MarketConnect addon services.

Parameters

Builder $query

Return Value

Builder

Builder scopeIsConsideredActive (Builder $query)

Parameters

Builder $query

Return Value

Builder

Builder scopeIsNotRecurring (Builder $query)

Parameters

Builder $query

Return Value

Builder

BelongsTo service ()

Each addon belongs to one service.

Return Value

BelongsTo

BelongsTo productAddon ()

Each addon belongs to a single product addon.

Return Value

BelongsTo

BelongsTo client ()

Each addon belongs to one client.

Return Value

BelongsTo

HasMany|CustomFieldValue customFieldValues ()

Return Value

HasMany|CustomFieldValue

protected getCustomFieldType ()

protected getCustomFieldRelId ()

BelongsTo order ()

An addon belongs to a single order.

Return Value

BelongsTo

HasMany paymentGateway ()

Each addon has many payment gateway records.

Return Value

HasMany

Properties getServicePropertiesAttribute ()

Return Value

Properties

HasMany ssl ()

Each addon could have many ssl records.

Return Value

HasMany

bool canBeUpgraded ()

Determine if addon can be upgraded.

Return Value

bool

bool isService ()

Is this entity a service?

Return Value

bool

bool isAddon ()

Is this entity an addon?

Return Value

bool

HasOne serverModel ()

Return Value

HasOne

HasMany failedActions ()

Return Value

HasMany

string legacyProvision ()

Run provision action in legacy mode.

Legacy mode returns 'success' on success and an error message string on failure.

Return Value

string

bool isRecurring ()

Return Value

bool